Editor’s note: The following thoughts are from a U.S. military veteran, a combat veteran of the war in Afghanistan, and a graduate of the military’s Survival, Evasion, Resistance, and Escape program, who wrote this piece for Task & Purpose under the condition of anonymity.

The story of Army Sgt. Bowe Bergdahl — the recently released lone American prisoner of war in Afghanistan — is shrouded in controversy and has sparked an incredible debate about how he fell into the hands of the Taliban, and what the past five years have been like for him.

How to behave in enemy hands has been the subject of modern military studies and training for decades. The military established it’s first SERE program — Survival, Evasion, Resistance, Escape — during the Korean War.

Here’s what modern SERE training teaches you to do in the event you’re captured by enemy forces.

1. Escape

The very first moments of an abduction are the most critical. It’s confusing, hectic, and chaotic — for captive and captor alike. If an opportunity presents itself, try to escape during this initial stage. Otherwise, it will only get harder, and you may be in for a long haul.

2. Remember your surroundings

You may be bound, blindfolded, thrown in a trunk; your captors will deliberately try to disorient you. Try to orient yourself when you’re being transferred, even if you can’t see; left turns, right turns. Draw a map in your head so that when you arrive at your destination, you’ll have a rough idea of how to leave.

3. Resist

Article 5 of the U.S. Military Code of Conduct states: “When questioned, should I become a prisoner of war, I am required to give name, rank, service number and date of birth. I will evade answering further questions to the utmost of my ability.”

To the utmost of my ability.

If someone is jamming a gun in your face, you might not be able to evade answering their question. Your country wants you home alive. The tough guy refusals to comply you see in movies will probably get you killed, so resist with discretion.

If your captors want information, play dumb. You’re a lowly private who doesn’t know anything. If you’re higher ranking, you have your aides work out all the battle plans, and you don’t know them yourself. Hell, tell them you just make the coffee in the office.

If your captors force you to work, don’t outright refuse. Resist by working slowly, clumsily, making mistakes, but not enough to really piss off the bad guy with the gun.

4. Keep the faith

Keep the faith in your God, your country, your family, your fellow captives, yourself. Whatever helps you to get through your captivity. You may be a prisoner for years. Know that your country is trying to get you back. Know that the people back home haven’t forgotten about you. Don’t fall into despondency; keep yourself occupied by trying to find a way out.

Adm. James Stockdale was a prisoner of war in Vietnam for almost eight years. His actions in captivity earned him the Medal of Honor.

He later said, “I never lost faith in the end of the story, I never doubted that not only would I get out, but also that I would prevail in the end and turn the experience into the defining event of my life, which, in retrospect, I would not trade.”

5. Come home with honor

Honor is a word that carries a lot of weight in the military community. Article 5 of the Code of Conduct states: “I will make no oral or written statements disloyal to my country and its allies or harmful to their cause.”

If you are being tortured and can no longer resist, if your life is in immediate danger, you may have to sign the document, or make the statement. But do what you can to resist.

Maybe you lost your voice. Maybe your hand is broken and you can’t write. When the North Vietnamese tried to use Stockdale for propaganda, he cut his head with a razor blade and beat himself with a stool to make himself unrecognizable. Resist.

Come home, but come home with honor.

Follow Task & Purpose on Twitter.