The comedic actor on his new middle-grade novel and facing your fears.

Q | Tell us about your inspiration for your new book, Nightmares!

A | I had terrible nightmares as a kid. Even though they were scary, there was something I always liked about being a little bit afraid. Later, I learned that our fears are what can make us stronger if we choose to face them. That’s really what the book is about.

Q | What have you enjoyed about writing for a younger audience?

A | There is a part of me that has stayed childlike as I’ve grown. It is that part that made me want to [cowrite] The Muppets [screenplay] and, later, Nightmares! Mostly, I just think it’s really fun.

Q | How did you become interested in writing and comedy?

A | When I met Judd Apatow on my first TV show, Freaks and Geeks. It was exciting to be so young and to learn from someone I admired.

Q | Any great teachers in your life?

A | I’ve been lucky to have some amazing teachers. To pay them back, I always try to use their last names as characters in my writing.