Mr. Segel, who is known for his roles on the popular CBS sitcom “How I Met Your Mother,” as well the cult favorite “Freaks and Geeks,” will write “Nightmares!,” an adventure series about a group of children who are determined to save their neighborhood from fear. Kirsten Miller will be the co-author.

“Ultimately, it’s a story about learning that we can accomplish anything, as long as we are brave enough to try,” Mr. Segel said in a statement. “These are the types of stories that always inspired me.”