Nobody likes to deal with a canceled or delayed flight, but you always need to prepare for the worst-case scenario whenever you travel. Flight cancelations are beyond your control, but there are some things that you can do when you find yourself unable to embark when you want to.

Avoid Getting Trapped at the Airport

The best way to deal with a canceled flight is to be prepared for it ahead of time. Before you leave for the airport, check to see if your flight has been canceled or delayed. Last-minute cancelations do happen, but you’ll likely hear that there’s an issue if you call ahead of time. That will give you time to book another flight or find a place to stay for the night.

Act Quickly

If you’re already at the airport when your flight is canceled, you need to act quickly to find a solution to your problem. Head to the airline agents’ desks as soon as possible to see if there are any other flights available. This is a first-come-first-serve scenario, so be prepared to wait in line even if you move quickly. You can always call your airline while you’re standing in line, too. You might find a solution to your problem before you have to speak to anyone face-to-face. If you do have to make a phone call, try an international call center, since domestic lines in the U.S. tend to have longer wait times.

Ask for Emergency Accommodations

Since your flight was canceled through no fault of your own, your airline might provide a voucher for a free hotel stay, so you won’t be stuck at the airport all night. There’s no guarantee that your airline will be able to help you, but it never hurts to ask.

Be Patient

Finally, be patient. Delayed and canceled flights are frustrating, but you can’t take that frustration out on the airport staff. They’re not at fault, and they’re only trying to help you. As long as you remain calm and patient with the staff, they will be far more likely to help you if they can.