If you’re heading to the beach or a summer picnic, a cooler (or two) filled with snacks and drinks is as essential as your sunscreen. Barbecue-bound? You’ll need to keep those burgers, dogs and potato salad plenty chilly, especially when the mercury is in sweaty territory.

Packing a cooler right may seem like a no-brainer — but plenty of people get it wrong without knowing it. Follow these tips from the food safety experts to make sure your outdoor meal stays free of illness-inducing bugs. (Keeping actual bugs away from the party is another story. You're on your own there.)

Don’t skimp on ice (or ice packs). Think less food, more ice. If you have a choice (and you’re not packing a huge cooler), opt for ice packs instead of ice. “Since melting ice water could ruin the quality of the food, frozen packs are your best bet,” says Nils Fischer, a research associate for the Center for Science in the Public Interest.

Use ice blocks rather than cubes. If you’re using ice, ask yourself how long you need the food to stay cold. Cubes may be more convenient because they can spread around the food, but for a long day at the beach, blocks stay colder longer. The same rule of thumb is true for gel packs: Bigger ones keep their cool better.

Related: Food Safety Fails

Fill 'er up. A full cooler will stay colder than a partially filled one (air takes much less energy to heat than food or water). If you have any extra room, throw in more drinks or more ice.

Store foods in airtight bags or sealed plastic containers to prevent cross contamination and contact with melting ice.

Keep raw meat separate. If you’re camping or planning a late afternoon barbecue, you should ideally store raw meat in its own cooler so you don’t risk contaminating other foods — especially foods you’re not going to cook — with dangerous bacteria such as E. coli or salmonella. If that’s not possible, store raw meat in double zip-lock bags and put them at the bottom of the cooler, not on top of other foods. “The base of a cooler will maintain a colder temperature to limit pathogen growth and it will be less likely to cross-contaminate other foods,” says Fischer.

Related: How to Thaw Meat

Pack food that’s already cold. Make sure all the food is cold before you put it in the cooler. Put drinks, fruit and other foods in the refrigerator the night before.

Consider a drinks-only cooler. Every time someone wants a drink, they open the cooler — and let some heat in. Keeping drinks in a separate cooler will help keep perishable food colder.

Buy an appliance thermometer. If you have food that can spoil, like sandwich meat, yogurts and salads, invest in an appliance thermometer. Make sure it reads 40 degrees F or below. If it starts to drift above that, you’ll have to eat the food in the next two hours, or in one hour if the temperature outside is 90 degrees or above, says Benjamin Chapman, PhD, board member of STOP Foodborne Illness, an education and advocacy group.

Related: 8 Tips For Healthy Barbecuing

Try partially burying your cooler in the sand to keep it cooler. Keep it in the shade under an umbrella and cover it with blankets.

Choose snacks less likely to spoil. For a day at the beach, pack peanut butter sandwiches, sliced cheese, fruits and veggies. If you’re packing hummus or other dips, try freezing them the night before so they stay cold longer.

Laurie Tarkan is an award-winning health journalist for the New York Times, national consumer magazines and websites.