The best way to fly cheaply is to purchase in advance. Particularly in the era of non-refundable tickets and optimized passenger loads, airlines charge a premium for last-minute flights.

Specifically, if you have the option, it's generally best to buy your tickets three or four months in advance. Earlier than that and airlines charge a premium for advance planning. (If you're buying eight months ahead, the airlines know you absolutely need that ticket and they charge accordingly.) Later, and they charge last-minute prices.

But you don't always have that option. Maybe you're taking advantage of some unexpected time off, maybe you have to respond to a family emergency. Whatever the reason, finding a flight at the last minute can get expensive fast. Here are a few tips to make it a little easier.

5 Tips on How to Find Cheap Last-Minute Flights:

1. Buy Your Ticket. Do It Now

Don't wait a minute longer. If you know you'll be flying, the time to buy your ticket is now.

As I wrote a few years ago, one of the most durable myths in travel is the idea that an airline will move tickets at fire sale prices immediately before a flight. Consumers expect that seats on a plane will act like any other expiring product. Once that plane takes off,  the value of each unsold seat drops to $0.00, so it makes sense for an airline to try and get some value back.

While that may have once been true, today most planes take off at capacity. What few seats remain aren't a liability… they're precious commodities for travelers who have absolutely no other choice. The moral of the story? Don't wait. Book your ticket now.

2. Be Flexible About Your Destination

We'll assume that you can't significantly change your date of travel. If you could, you wouldn't need a last-minute fare.

So instead, try to have some flexibility on where you fly.

Increasingly, websites like Kayak and Google Flights offer you the opportunity to search by destination. You can enter your starting city and dates of travel, and the website will populate a list of major destinations around the world paired with what it would cost you to fly there.

If you're traveling for pleasure, this can be an excellent tool for planning a quick getaway. Perhaps taking a long weekend to Paris might cost an arm and a leg, but what if flights to San Juan happen to be cheap right now? You can save a bundle by changing your plans a bit.

3. Be Flexible About Your Day and Time

That said, if you need to get an inexpensive ticket at the last minute, you will almost certainly need some flexibility about the day of the week you travel. Specifically, try to travel on a Tuesday or Wednesday.

These are statistically the cheapest days of the week on which to fly. One study by the website Cheapair.com found that tickets purchased on a Tuesday are about $85 less expensive on average than any other day of the week.

By contrast, stay away from the weekend. Sunday, in particular, is the most expensive day of the week on which to fly. Booking then will only compound your losses.

The same goes for time of day. Flying at the crack of dawn or in the middle of the night is unpleasant and inconvenient, which is why those flights tend to be less expensive than the high-demand ones in the middle of the day. If you're willing to rise with the sun, you can probably save some money.

4. Plan Ahead

This might seem counterintuitive, but there are a few things you can do ahead of time to prepare for if and when you'll need a last minute deal.

Stick to One Airline as Much as Possible

Most of us (myself included) tend to shop for airfare entirely around the price of a ticket. In fact, flying is one of the most brand and perk-resistant industries in the world. Customers pay attention to the sticker price and almost nothing else, which is why Spirit Air (SAVE - Get Report) is infamously loathed and but was once one of the most successful airlines in the country.

Give that up. As much as you practically can, stick to one airline when you fly. You will earn miles and status, which will help enormously when it's time to offset a last minute ticket price.

Get a good travel card.

Miles on your credit card can offer the same benefit. With a solid travel card, when it comes time to pay exorbitant airfare, you might just have a better option in the form of miles.

Sign Up for Price Alerts and Newsletters

If you have a destination that you visit often, or just one that interests you, sign up for price alerts. While last-minute airfares are mostly a myth, sometimes prices will drop in advance of a flight. It doesn't happen often, so make sure you get the alert when it does.

5. Search Airlines Individually

Most online travel agencies such as Kayak, Orbitz and Expedia (EXPE - Get Report) offer generally the same prices. When you find a difference, it's typically because one website will have pulled up a slightly different itinerary than another. This is because all of these websites get their information from the same central database.

However, one thing can change from website to website: Which airlines they list. Not every online travel agency will list every airline. Sometimes large companies like Southwest (LUV - Get Report) or Ryanair (RYAAY - Get Report) will be left out. What's more, it's very common for major websites not to list regional airlines at all.

As a result, when you search for flights, keep an eye on which airlines your website offers. If you can find a regional airline that flies to your destination, look them up directly. There's a good chance they didn't make the main listing and they might offer better deals.

The truth is, finding last-minute deals on airfare isn't easy. Over the past 20 years, airlines have gotten extremely good at managing their passenger loads. Planes fly more consistently full than ever, which means airlines don't have much incentive to cut deals and make special offers. For the most part, when it comes to flying, the price is the price.

That doesn't mean you should give up, though. With a little bit of legwork, you might just get lucky. It's certainly worth taking 20 minutes out of your day to try.

p> Watch: Audi, Jaguar, Ford: Here's What the Future of Electric Cars Looks Like