Walter Dean Myers tours his old Harlem neighborhood in New York on Dec. 13, 2010. The author died on July 1, 2014. (Charles Sykes/AP)

Walter Dean Myers, a best-selling and prolific children’s author who spent much of his adult life writing realistic and accessible stories about crime, war and life in the streets, died July 1 at a hospital in Manhattan. He was 76.

His publisher, HarperCollins, announced the death but did not disclose the cause. Mr. Myers was a resident of Jersey City.

A onetime troublemaker who dropped out of high school, Mr. Myers completed more than 100 books and was a leading advocate for including other races in children’s books.

In 2012-2013, he served as National Ambassador for Young People’s Literature, a position created in part by the Library of Congress. He was an unofficial ambassador well before that, visiting schools and prisons and libraries around the country.

Mr. Myers’s books were usually narrated by teenagers trying to make right choices when the wrong ones were so much easier. There was the 17-year-old hiding from the police in “Dope Sick” (2009) and the boarding school student in “The Beast” (2003) who learns his girlfriend is hooked on drugs. He was careful not to make judgments, and in the crime story “Monster” (1999), he left doubt over whether the narrator was really guilty.

One of five siblings, he was born Walter Milton Myers in Martinsburg, W.Va., on Aug. 12, 1937.

His mother died when he was 18 months old, and he was sent to Harlem and raised in a foster home by Herbert and Florence Dean, a janitor, and a cleaning woman and factory worker, respectively. In honor of his foster parents, he took the pen name Walter Dean Myers.

Over 6 feet tall by middle school, he was a basketball star but also a stutterer who was teased often and fought back in return. Meanwhile, back home, he was happy to sit quietly and read.

“There were two very distinct voices going on in my head and I moved easily between them,” Mr. Myers wrote in his memoir, “Bad Boy,” which came out in 2001. “One had to do with sports, street life and establishing myself as a male. . . . The other voice, the one I had from my street friends and teammates, was increasingly dealing with the vocabulary of literature.”

Mr. Myers was gifted enough to be accepted to one of Manhattan’s best public schools, Stuyvesant. But he was also shy, too poor to afford new clothes and unable to keep up with the work. Mr. Myers began skipping school for weeks at a time and never graduated.

He told the New York Times that his home life grew increasingly tense. An uncle was killed, leading his foster father into a depression. His foster mother was an alcoholic. Mr. Myers said he also spent many years drinking heavily. He called it a “drunken stumble through life, with me holding on just enough to survive.”

“I know what falling off the cliff means,” he told the Associated Press in 2011. “I know from being considered a very bright kid to being considered like a moron and dropping out of school.”

He served in the Army from 1954 to 1957 and later was employed as a factory worker, a messenger on Wall Street and a construction worker. Anxious to be a writer after reading James Baldwin, he contributed to Alfred Hitchcock’s mystery magazine and numerous sports publications.

His first book — “Where Does the Day Go?” — was published in 1969 after he won a contest for children’s literature by people of color.

His visits with students and inmates not only gave him the chance to help others straighten out their lives but also inspired some of his work. “Lockdown” (2010), a National Book Award finalist, began after Mr. Myers met a kid who was afraid to get out of jail because he would only get in trouble again.

For “Monster,” he remembered a boy who would talk about the crimes he committed in the third person, as if someone else had committed them.

“Then I found out that all the guys could do that. They could separate themselves from their crimes,” Mr. Myers told the Associated Press. “We come up with strategies for dealing with our lives and my strategy might be different because my life has been different.”

His 2008 novel “Sunrise Over Fallujah” was about a young man who enlists in the military out of patriotic fervor after the Sept. 11, 2001, terrorist attacks and finds the war far more complicated than he ever imagined.

“This is an astonishing book,” author Leonard S. Marcus wrote in the New York Times review. “Like the war it chronicles, its main characters’ stories have yet to come to a close. . . . We leave them not knowing who will make it home.”

Mr. Myers’s novel “On a Clear Day” is scheduled to come out in September.

His first marriage, to Joyce Smith, ended in divorce, and a daughter from that marriage, died. In 1973, he wed Constance Brendel. Besides his wife, survivors include a son from his first marriage and a son from his second marriage.

In March, he wrote an essay in the Times lamenting the lack of young adult fiction that examined the lives of inner-city youth, particularly blacks and Latinos. This, he added, was his life’s mission — “to make them human in the eyes of readers and, especially, in their own eyes. I need to make them feel as if they are part of America’s dream, that all the rhetoric is meant for them, and that they are wanted in this country.”

From staff and wire reports