When you’re traveling overseas, paying for things can become stressful and expensive.

Not only are there exchange rates to navigate, but you also need to worry about ATM and credit card fees and whether the transaction is even secure.

But by doing a little bit of planning before your trip and selecting the right cards, you should be able to avoid most of the hassle.

Using credit cards abroad

If you’re traveling in a place where plastic is possible, your best bet is to use your credit cards and skip the debit cards.

Not only can you accumulate points with some credit cards, but they also provide the strongest level of security (a lot more damage can be done with a stolen debit card than a stolen credit card).

But be wary of fees. Some card issuers charge a foreign transaction fee if you use your card overseas or buy something online from a retailer based abroad. Some charge no fees. So be sure to read your card’s terms first.

When Daniel Tobias and his wife Jillian were preparing to spend 21 months traveling around the world, selecting ATM and credit cards without foreign transaction fees was critical to reducing their pre-trip anxiety.

Tobias said they used their cards for more than 90% of their total on-the-ground spending, which they estimated saved them thousands of dollars in fees.

“When visiting countries without reliable access to western banking at the time, like Sudan, Ethiopia, Zimbabwe, Uzbekistan, we needed to bring extra US dollars in with us, but otherwise we relied on cards,” Tobias said.

These days you don’t have to make major tradeoffs or be an elite card member to avoid foreign transaction fees.

“The good news is we’ve steadily seen more and more cards do away with foreign transaction fees,” said Matt Schulz, chief industry analyst at CompareCards. “That’s great for consumers because traveling can be expensive enough and the last thing you want to do is to spend extra on fees.”

Sites like CompareCards, The Points Guy, Nerd Wallet and CreditCards.com allow users to search for cards with no foreign transaction fees.

Another thing you should also be mindful of, Schulz recommended, is the card networks that are most frequently used at your destination.

Visa and Mastercard are more widely accepted internationally than American Express, he said. But if you regularly travel to China, for example, you may want to look at Discover.

Another difference between American credit cards and those issued in other countries is that US cards use a chip and a signature for verification, while those abroad tend to use a chip and a personal identification number, or PIN. But Americans who travel frequently may want to get a chip and PIN card. Providers like Bank of America and Barclays offer chip and PIN cards that can be used in the US or abroad.

“It won’t be a problem in the most touristy spots,” Schulz said, “but if you’re off the beaten track a bit, having a chip and PIN card will help avoid some headaches.”

Using an ATM card for cash

In some places, your only option is cash. You just need to use caution about where you get your cash from. Retail money exchanges, particularly in tourist destinations, aren’t usually your best bet, according to JP Geisbauer, a certified financial planner and principal of Centerpoint Financial Management in Newport Beach, California.

He warns against exchanging money at kiosks in an airport, train station or heavily visited tourist areas.

“These rates are almost always the worst possible rates around,” he said.

Instead, he suggests using an ATM machine.

Unless your card waives fees, there will be a cost associated with using an ATM abroad. But these fees are generally much cheaper than the conversion rates and related fees offered at retail money exchanges, Geisbauer said.

Many banks charge an international ATM fee, often ranging from $1 to $5 per transaction, as well as a foreign transaction fee or currency conversion fee, which is a percentage of the amount you withdraw, usually ranging from 1% to 3%.

To help avoid getting hit with so many fees, check to see if your bank has partner ATMs in your destination. That will at least help you avoid an out-of-network usage fee, if not the ATM operator’s access fee.

Also, be aware that some countries only allow up to 4-digit PIN numbers at ATMs, said Geisbauer. So if your PIN is longer than that, you may want find out the standard where you are traveling and think about changing it before hitting the road.

“Trying to change [your PIN] while on the road is not impossible, but can be an unnecessary time waste while traveling.”

But even the best cards can’t prevent user error.

Tobias recalled being a little too sleepy arriving in China after an overnight bus from Kazakhstan and leaving his ATM card in the machine. Security measures kicked in and nothing was lost or stolen, but handling the loss and finding the Fed-Ex package with the new cards their bank sent to them in Beijing was an added and unexpected adventure.