Air travel requires passengers to undergo various security checks before boarding their flight. One of the most common restrictions involves limitations on liquids that travelers can bring onto planes. Understanding these liquid rules is key to getting through airport security quickly and smoothly.

The restrictions on liquids stem from a foiled terrorist plot in 2006 to detonate liquid explosives on board several transatlantic flights. This led air authorities to ban all liquids, gels, pastes, lotions and other similar substances from carry-on luggage. Passengers were only allowed to bring small amounts needed for medical purposes.

Over time, the rules have been relaxed slightly. Today, each traveler is permitted to carry liquids, gels and aerosols in containers no larger than 3.4 ounces or 100 milliliters. These containers must fit comfortably within a single quart-sized clear plastic zip-top bag. To qualify, the bag must be no more than 8 by 12 inches and completely sealed. Each traveler is limited to one plastic bag for their carry-on.

This rule applies to any kind of liquid, including things like shampoo, toothpaste, makeup, creams, perfumes, and water bottles. Food items like yogurt, peanut butter, jams, jellies, syrups, oils and salad dressing also fall under the liquid category. Basically, if it can spill or spray, it needs to comply with the size limit. The only exceptions are medications, baby formula and breast milk.

So what should you do if you want to bring a normal-sized bottle of shampoo or lotion in your carry-on bag? Simple – transfer the liquid to a smaller container that follows TSA’s 3-1-1 rule (3.4 ounces or less, 1 quart size bag, 1 bag per person). This may mean buying a set of empty travel bottles to portion out what you need for your trip. Many pharmacies and travel stores sell appropriate containers for this purpose.

When going through security, have your plastic bag of liquids easily accessible – not buried deep in your bag. Be prepared to remove it and place it in a bin for screening. You may also need to take off outer layers like coats and jackets and remove laptops from cases. Wearing easily removable shoes can speed things up as well.

After screening, retrieve your belongings including your liquid bag. Be aware that TSA officers may ask to examine any liquid items more closely, so don’t seal up your liquids bag completely tight. If selected for additional screening, you may have to open containers for testing.

If you’re running late and didn’t decant your liquids before arriving at the airport, there are usually stations near the security line where you can transfer items into smaller bottles. But this takes extra time, so come prepared if possible.

What happens if you get caught with a liquid that exceeds the permitted volume? Unfortunately, the item will need to be surrendered to TSA officials before entering the security checkpoint. They will dispose of any prohibited items. The good news is you won’t face any fines or jail time, as long as you cooperate.

The 3-1-1 liquid rule is enforced at every airport in the U.S. It also applies to most international flights departing from the U.S. However, other nations may have slightly different policies, so check regulations at your destination. Long story short – it’s better to stick to less than 3.4 ounces no matter where you’re traveling.

While limiting liquids seems like a hassle, these measures are in place for our safety. Terrorists are still actively trying to target commercial aviation. Following TSA’s guidelines helps detect deadly liquids and gels that could be used in an attack. A few extra minutes preparing your liquids is a small price to pay for security.

With a little planning ahead, you can abide by the liquid rules and still bring necessary or precious items in your carry-on luggage. Eventually, the screening process may be updated with advanced technology to make it less intrusive. But for now, the 3-1-1 rule allows airport security to restrict potentially dangerous liquids while allowing travelers to bring essentials onboard their flight.