When Jazmyn Strickland went to a county fair with her girlfriend recently, she realized that the concession stands around her only accepted cash.

“I never carry cash,” says Strickland, a wedding and event planner in San Luis Obispo, California.

She decided not to go to one of her bank’s ATMs, though. “We’re not going to leave the fairgrounds, leave the parking lot, go find an ATM that works for us, go find parking, pay for parking again and walk back to the fair,” says Strickland. She ended up withdrawing $100 at an ATM at the fair, which cost a $4 fee plus her bank’s out-of-network fee.

» MORE: Best banks for ATM lovers

Despite the increase in electronic payment options, cash still has a place in present-day finances. If you are at a cash-only venue, you will need a way to get dollar bills, and the most convenient option available might be an ATM that charges you fees. Nationally, the average out-of-network ATM withdrawal fee charged by financial institutions is $2.01 and the average ATM surcharge for non-customers is $2.75, according to 2016 data from Informa Research Services in Calabasas, California.

But the fees are not inevitable. Here are four ways to dodge them.

1. See if plastic or digital wallets are accepted

If you know the specific place you’re going to, whether it’s a restaurant, merchant or government office, call it or check for it on a business search app like Yelp or Foursquare. For events such as county fairs or concerts, check out their websites for information about payment options before you get cash. You generally can find out whether credit cards or digital wallets such as Apple Pay and Android Pay are accepted, in which case you can avoid using cash altogether.

2. Find an ATM in your bank’s network

When you have no choice but to get cash, see how close you are to an ATM in your bank’s network. Most banks and credit unions offer a free ATM network, whether it’s their own brand or a shared network such as Allpoint, MoneyPass or Co-Op. You can generally find the in-network ATM closest to you by using an ATM locator on your financial institution’s mobile app, or simply through a web search.

3. Get cash back at a store checkout counter

If you aren’t near one of your bank’s ATMs, look for a grocery store or big retailer. Many of these offer no-fee cash back as a part of your purchase when you use a debit card or prepaid debit card at checkout. When you’re asked “debit or credit,” select “debit” to get cash back. You’ll also need to enter your four-digit personal identification number. This cash-back option generally is not available with credit cards.

4. Choose a bank or credit union that reimburses ATM fees or has a larger network

If your ATM fees combined with other fees your bank charges are hurting your wallet, it might be time to consider a new bank. Some online banks and community financial institutions refund ATM fees — either an unlimited amount or up to a total of $10 to $25 per month. Try out this checking account comparison tool and filter by out-of-network ATM fees to see which banks offer such refunds.

Alternatively, you may need a bank or credit union with more ATMs, especially in your area. If you travel frequently, consider banks that don’t have foreign ATM or debit card transaction fees.

“Paying ATM fees is an avoidable waste of money,” says Carrie Houchins-Witt, certified financial planner and owner of a financial services firm at Carrie Houchins-Witt Tax & Financial Services in Coralville, Iowa. “Better to keep your hard-earned money than give it to the bank.”

Spencer Tierney is a staff writer at NerdWallet, a personal finance website. Email: spencer@nerdwallet.com. Twitter: @SpencerNerd.

The article How to Avoid ATM Fees originally appeared on NerdWallet.