WHEN PUBLISHER Random House reached out to Eisner Award-winning writer Brian Michael Bendis to see whether he was interested in creating a book about how to write comics, Bendis knew he had to do it.

Known for writing some of the top Marvel titles — as well as such creator-owned titles as “Powers” and “The United States of Murder Inc.” — Bendis was already teaching a class on how to write graphic novels at Portland State University when he was approached by the publisher, so putting together a book on making comics seemed natural.

After reaching out to some of the comics industry’s other top talent for contributions — and carving out time in his busy comics-writing docket — Bendis poured professional wisdom into “Words for Pictures: The Art and Business of Writing Comics and Graphic Novels,” which hit shelves and virtual shops this week.

“You had to be an archaeologist to find that information when I was younger, pre-Internet,” says Bendis, who is appearing at San Diego Comic-Con this weekend (his schedule includes time at the Marvel booth). “So I lost a couple of hours of sleep [writing this book]. That’s OK. I’m very proud of the book, and I’m very rarely proud of anything, so it was all worth the struggle.”

Bendis says he strived to make “Words for Pictures” the book he sought, but never found, when he was a young writer hungry for tips from pros.

“This is the perfect example of making something you wish existed,” Bendis tells The Post’s Comic Riffs. “This is the book I wanted when I was 20. [These are] exactly the questions I would have asked, and [within the book] there are answers from the best people I know.”

Bendis’s social-media accounts speak to the strong appetite for how-to information. Through his Tumblr and Twitter accounts, he receives many questions from fans wanting to know how he crafts his stories. Bendis says it was harder to give direct answers while working on “Words for Pictures.”

“Some people come to me with elaborate questions, some of which I can’t answer properly because literally I dedicated 20 pages of my book to [the answer], that’s how complicated the questions are,” says Bendis (Uncanny X-Men, New Avengers, Guardians of the Galaxy).

Now that “Words for Pictures” is available, Bendis is looking forward to giving short, bit.ly-enhanced answers from here on out. “It’s gonna be fun to just link to that Amazon link. BOOM. There ya go,” Bendis says. “So anybody who follows me on Tumblr, get used to that.”

“Words for Pictures” covers everything from making a pitch to script writing; the book even goes over the delicate process of creative collaboration.

“It’s a little like dating,” Bendis says of a writer interacting with an artist he or she is collaborating with. “We try to demystify that, as well.”

In sharing his tips about the business side of the industry, too, Bendis says that’s an area even some current pros don’t pay enough attention to.

“I know some big-name working professionals who wouldn’t hire a lawyer because it bores them, and then they want to know what happened,” Bendis says. “No matter how many horrible stories you hear everyday. … ‘People come to my house and say: ‘Help me untangle this mess. You’re doing it right. What should I do?’ And then 10 minutes later, they’re moaning.”

The business side, he says, is “about protecting your work being just as important as making your work.”

What does Bendis hope aspiring writers will ultimately take from his book?

“We want you to get the feeling we get,” he says, “when it all works out.”