If your flight is delayed or cancelled but you are not at the airport: your airline is technically in breach of contract if they cancel your flight. They have to offer you a refund or an alternative flight. If you have accommodation booked, try to get a refund or new dates with them. If you have booked through a package holiday company, they will usually meet a claim for accommodation costs.
If your flight is delayed or cancelled and you are at the airport: If you airline is an EU airline, they are bound by EU law to offer you a refund or alternative flight. They are also bound by a duty of care to provide you with food and accommodation. You will be able to make a claim for travel delay for each block of 24 hours' delay.