It’s a traveler’s nightmare: Your passport is gone. This means, of course, you can’t get back into the United States or travel between most other countries. But try not to panic. Here’s what you’ll need to do.

First, if you think you lost it, retrace your steps. Did you put it in a different place than usual, or were you required to leave it at the hotel desk during your stay?

Once you’re sure it’s gone, call the nearest U.S. embassy or consulate to report the loss, the State Department says. This helps prevent someone else from using your passport or stealing your identity. Once you report your passport as lost or stolen, it becomes invalid and can’t be used.

Next, fill out a passport application (form DS 11) and a statement of loss form (DS-64) — they’re both available on the State Department’s website. No matter where you are abroad, it costs $110 to apply for a new passport plus a $25 fee for a replacement passport. Each embassy or consulate has its own protocol, so ask the nearest one for instructions on how to proceed with the forms, where to get an acceptable passport photo and, if the passport was stolen, whether you should file a police report and give the embassy a copy.

Related: Travel Safety Tips: 6 Common Scams to Beware

You’ll need to give the embassy the email address you are using outside the United States and the name and contact information of a person in the United States or abroad who can help reach you. You must also provide your Social Security number, a photo ID, proof of citizenship (which could be a photocopy of the missing passport, your birth certificate, Consular Report of Birth or Certificate of Naturalization or Citizenship) and your travel itinerary (train or plane tickets).

Related: Who Needs Travel Insurance? You Might

It takes up to four to six weeks for the United States to issue a new permanent passport and send it to the embassy or consulate. If you need to travel sooner than that, ask the embassy about making an appointment to get an emergency limited-validity passport. If you’re traveling as soon as the next five days, ask whether emergency walk-in services are available. However, even in the most extreme emergencies it is unlikely a temporary passport can be issued until the next business day.

Unless the embassy takes credit cards, you likely will be expected to pay the fees in cash in the local currency. If your money was stolen and you can’t pay the fees, reach out to a friend or family member for financial help. In emergency situations, the fee may be waived until the temporary passport is exchanged for a permanent one after you get back to the United States.

Related: Dumbest Things People Do on Airplanes

One note: Active duty military personnel follow a different procedure and should consult with their chain of command to be referred to a military acceptance agent.

Of course, the best thing is to take measures to avoid losing your passport in the first place. Keep your passport and most of your cash and credit cards in a zippered travel wallet and wear it under your clothing.

Make replacing your passport easier by copying the photo and information page. Keep one copy in a secure place separate from the passport and another with a trusted friend or relative not traveling with you. Some people keep a scan in an email or store in online using a service like Dropbox.

One last tip: Complete the emergency information page of your passport in pencil so you can update it.

Related: The Worst Clothing Mistakes American Tourists Make

Linda Fasteson is an award-winning writer with who specializes in travel tips for Baby Boomers. In addition to her Sunday newspaper travel feature stories, Baby Boomer Travel and Travel Deal columns, and website, NotableTravels.com, she has been a panelist for major publications and international tourism boards and is a contributor to a variety of magazines, forums and reviews.