Carolina Contreras, a 34-year-old business owner who flies frequently between New York and Santo Domingo, in the Dominican Republic, has been using JetBlue exclusively for her trips for almost a decade without a problem. But on her last two flights, she said her flights were delayed for hours; one was pushed back six times.

“I have to be places. I have to rest,” Ms. Contreras, whose salon, Miss Rizos, has locations in both cities, said. “I know how hard the pandemic has been, but people need to get it together.”

Ms. Contreras is not alone. Thousands of flights were delayed or canceled by airlines in the last few weeks as travel has picked up, with airlines blaming bad weather and labor shortages for the disruptions.

“We’re obviously in a new world, and there are a lot of changes, rules, restrictions, openings, closures, spikes and also supply and demand issues for the airlines,” said Michael Holtz, the chief executive of SmartFlyer, a New York City-based luxury travel agency. “Frankly, no one can really keep up.”

If you find yourself stuck at an airport with a canceled or delayed flight, here’s what you should know.

If possible, try to book directly through the airline rather than through an online travel agency, which may make it more difficult to change your itinerary in case of a cancellation or delay.

“Your rights under the law are still the same,” said Scott Keyes, the founder of Scott’s Cheap Flights, a service that tracks and emails airfare deals to customers. But dealing with an airline he said, is “going to be simpler and generally more efficient.”

You should also make sure you have all the necessary documentation required for travel, such as a negative Covid-19 test or proof of vaccination, which many countries require for entry. “A lot of people don’t have the right information before they get to the airport, and then there’s a lot of confusion,” Mr. Holtz said.

Check in 24 hours in advance of your flight and, if possible, Mr. Holtz recommends traveling with only a carry-on so you can skip the check-in or baggage drop lines, which can often be very long.

You should also keep checking your flight status before heading out, in case there are any delays or changes to your flight. It may be helpful to download the application for the airline you’re flying with so you can more easily track your flight and any schedule changes.

Under federal law, airlines are obliged to provide a full refund to customers if a flight is significantly delayed and the passenger chooses not to travel. What constitutes a significant delay is determined by the airline, but Mr. Keyes said that two hours is usually a good rule of thumb. You should check your airline’s website for its contract of carriage, which outlines the policies, for more specific information.

If you choose to travel, you should get in line to speak with a gate agent to discuss your options. You’ll typically be placed on the next flight with available seats. You can also call the airline, but considering the long wait times on a lot of U.S. customer service lines, Mr. Keyes recommends trying one of the airline’s international numbers, which are listed on their website’s “contact us” pages and might have a shorter wait.

“You want to make sure you know what the cellphone rates are,” he said, “but if you’re calling Canada, it’s like two cents a minute. It’s going to be a 20-minute call versus a three-hour wait if you’re calling a U.S. hotline. I think it’s worth 40 cents.”

If you booked through an online travel agency, such as Expedia or Orbitz, you will need to call it directly to resolve your issue. “The airline generally won’t want to deal with you,” Mr. Keyes said.

If you choose to keep traveling, you are not entitled to compensation under federal law, but some airlines may offer it if the delay is their fault, such as if it’s caused by a mechanical or staffing issue.

American Airlines, for instance, will arrange an overnight stay for customers whose flight is delayed and does not board before midnight on the scheduled arrival day, said Andrea Koos, a spokeswoman for American Airlines.

JetBlue offers compensation for flights delayed three or more hours, from $50 to $200, depending on the length of the delay. If your flight was booked directly through the airline, it will email you within seven days of the flight’s scheduled departure to provide instructions for receiving compensation, according to its Customer Bill of Rights. If you booked through a third party, such as Expedia or Orbitz, you’ll need to call that company’s customer service line to ask for potential compensation.

If the delay is caused by an act of God, such as bad weather, and you’re stuck somewhere overnight, you’re on your own when it comes to meals and lodging.

If your flight is canceled by the airline, you will either be accommodated on a later flight or, if you decide not to travel, you are entitled to a full refund under federal law. If the flight had multiple stops, you would be refunded for the unused portion of the flight.

Often, airlines will offer travel credits or vouchers in lieu of a full refund, usually valid within a year of use. “That’s why it’s so important to know your rights under the law,” Mr. Keyes said. “If you decide not to take a trip, try to push for getting a cash refund rather than a voucher. This may sound very obvious, but cash is a lot more valuable than an airline voucher.”

If you decide to accept a later flight, you should get in line to speak to the gate agent (or the customer service desk, if directed there). But Mr. Keyes recommends doing your own research beforehand to see what flight works best for you, including looking at partner airlines for your carrier, and asking the agent whether there’s room on another carrier’s flight.

“When a flight gets canceled, the agents have tons to deal with, and they’re just trying to figure out how to get the situation resolved,” he said. “They’re not necessarily trying to figure out what’s the best, simplest, most appropriate flight for your specific situation.”

While you’re in line, call the airline or online travel agency through which you booked your flight, in case you can get help before reaching the gate agent.

In recent years, travelers have taken to social media to express travel frustrations or reach customer service, but Mr. Keyes said airlines are encouraging people to call their customer service lines.

Airlines may also offer compensation, but you’re not entitled to it under federal law. In JetBlue’s case, if it cancels a flight within four hours of its departure and cannot accommodate a traveler within an hour of the scheduled departure time, it offers $50 in compensation. If the cancellation happens after the scheduled departure, the number goes up to $100.

Delta will put up passengers whose flights are canceled between 10 p.m. and 6 a.m. at one of its contracted hotels for the night, but, if no rooms are available, it provides a voucher for up to $100 that can be used toward future travel.

If you believe your experience warrants compensation, just ask. “Generally the airlines will be more cooperative as far as compensation if the flight is canceled,” Mr. Holtz said.

And make sure to be kind and courteous, Mr. Keyes said.

“If you’re an airline agent, especially with these hourlong holds, your entire day is spent dealing with irate, frustrated, impatient customers who are frankly not treating you nearly as well as you ought to be treated,” he said. “If they have somebody who’s actually treating them in a humane way, I think they’re much more likely to actually go out of their way to try to help you.”

Mr. Keyes also noted that airline agents have a fair amount of discretion, so you shouldn’t give up if the person you speak with isn’t receptive.

“Rather than trying to lobby or argue with this person, which is almost never going to work,” he said, hang up and call again. “You’re going to get patched through to one of the thousands of other agents, each of which might say ‘yes.’”

If you receive a travel credit for a canceled flight and you booked directly through the airline, you will typically be able to redeem it directly through the airline’s app or website.

After you log into your account, there will be an option to apply a travel credit to your purchase at check out.

Airlines usually send an email with instructions for redeeming a travel credit, but information can also be found on the airlines’ websites. American Airlines, for example, offers detailed instructions on how to redeem the various types of credits it gives passengers.

But the type of ticket you purchased matters. If you originally bought a basic economy ticket, which is technically nonrefundable, you may have to call the airline directly to rebook.

If you booked through an online travel agency, the credit will need to be used on its site, Mr. Keyes said.

Follow New York Times Travel on Instagram, Twitter and Facebook. And sign up for our weekly Travel Dispatch newsletter to receive expert tips on traveling smarter and inspiration for your next vacation. Dreaming up a future getaway or just armchair traveling? Check out our 52 Places list for 2021.