Gordon Livingston in 2004. (Grant L. Gursky/For The Washington Post)

Gordon Livingston, a psychiatrist and best-selling author who wrote about self-induced unhappiness and some possible cures, as well as about his own grief and anger over the deaths of two sons, died March 16 at a hospital in Columbia, Md. He was 77.

The cause was heart ailments, said a daughter, Emily Livingston.

Dr. Livingston was a West Point graduate and onetime Army physician who at the height of the Vietnam War was sent home as an “embarrassment to the command.” His offense: composing and distributing a satirical prayer at an Army ceremony on Easter Sunday 1969, in which he asked God to “help us to bring death and destruction wherever we go.”

As an author, he was best known for the 2004 bestseller “Too Soon Old, Too Late Smart,” a variation on a Dutch proverb. The book has been translated into 22 languages. It contains a foreword by the late Elizabeth Edwards, the lawyer and wife of former vice presidential candidate and senator John Edwards (D-N.C.). She also had grieved the loss of a child.

The book includes essays on what Dr. Livingston called 30 bedrock truths. Among them: “Any relationship is under the control of the person who cares the least.” “Only bad things happen quickly.” “Forgiveness is a form of letting go, but they are not the same thing.” “The statute of limitations has expired on most of our childhood traumas.”

Dr. Livingston found in one military experience an apt metaphor for decisions in life amid circumstances that cannot be controlled. He was a young officer on a training exercise, and his map showed a hill that he could not see anywhere around him.

Flummoxed, he asked a more-experienced sergeant for advice. “Sir,” the sergeant said, “if the map don’t agree with the ground, then the map is wrong.”

A reviewer for Publishers Weekly wrote that “Livingston’s words feel true, and his wisdom hard-earned. Among the many blithe and hollow self-help books available everywhere, this book stands out as a jewel.”

Gordon Stuart Livingston was born in Memphis on June 30, 1938, and he grew up in Albany, N.Y., where his father was a Veterans Administration physician. He graduated in 1960 from the U.S. Military Academy at West Point, N.Y.

For two years, he was an infantry officer, serving as a parachutist and an Army Ranger in the 82nd Airborne Division. While still in the Army, he attended Johns Hopkins University’s medical school, graduating in 1967.

He volunteered for service in Vietnam, arriving in November 1968 as a surgeon assigned to the 11th Armored Cavalry Regiment. In a letter published by the Saturday Review in 1969, he described how he quickly grew disillusioned about American involvement in the war, namely the “indiscriminate destruction of lives and property,” and at what he called the overwhelming “criterion by which a commander’s performance is judged: the body count.”

His outrage mounted. At the change-of-command ceremony involving then-Col. George S. Patton, the son and namesake of the World War II general, Dr. Livingston passed among the guests copies of his satirical prayer.

It said, in part: “Grant us, O Lord, those things we need to do thy work more effectively. Give us this day a gun that will fire 10,000 rounds a second, a napalm which will burn for a week. . . . We thank thee for this war fully mindful that while it is not the best of all wars, it is better than no war at all.”

Attending the ceremony were Gen. Creighton W. Abrams Jr., the U.S. military commander in Vietnam, and 19 other generals. Relieved of his duties, Dr. Livingston was sent back to the United States as an “embarrassment,” but he was allowed to resign his commission and received a general discharge.

Just before leaving Vietnam, he was awarded the Bronze Star Medal for an action several months earlier. He had persuaded a U.S. helicopter to land behind enemy lines to assist a wounded enemy soldier, whom he took into custody. The Army credited this as a capture.

After Army service, he trained in adult and child psychiatry at Johns Hopkins, then began practicing in Howard County, Md. For 34 years, he was chief of psychiatry for the Columbia Medical Plan, an HMO, and he practiced psychiatry with Crossroads Psychological Associates until shortly before his death.

His marriage to the former Katherine Lowry ended in divorce. Survivors include his wife of 38 years, Clare V. King of Columbia; three children from his first marriage, Kirsten Livingston of Guilford, Conn., Nina Livingston of Durham, Conn., and Michael Livingston of Madison, Conn.; a daughter from his second marriage, Emily Livingston of Washington; and four grandchildren.

In “Only Spring: On Mourning the Death of My Son,” written after the 1992 death of his 6-year-old son, Lucas, from leukemia, Dr. Livingston described his anguish, compounded by the suicide, by hanging, a year earlier of his 22-year-old son, Andrew, who struggled with bipolar disorder.

Reflecting on the loss of children, Dr. Livingston once told The Washington Post:“The lesson, if there is a lesson to be learned from something like that, is that we endure what we must. I don’t find anything more profound than that.

“Most of the lessons that people imagine bereaved parents learn are really lost on most bereaved parents: This idea that somehow you achieve some sort of ‘closure,’ which is a word that is just hated by parents who have lost children, because there really is none to life’s really profound losses. And then people say, ‘You’re so strong. You got through this.’ And the answer to that is, ‘What choice do you have?’ ”