(CNN) Growing up as an evangelical, Pete Holmes thought he was doing everything right. He believed in the Bible -- all of it -- and said he didn't smoke, drink or have sex before marriage.

He went on mission trips to Africa, played bass on the worship team, even wore pleated khakis.

Then one day, as Holmes was struggling to kick-start his comedy career, his wife left him for another man.

His world, and his belief in God, exploded.

"I felt like the Lord hadn't held up His end of the bargain," Holmes writes in his new memoir, "Comedy, Sex, God" -- "and I was pissed."

But Holmes' spiritual search didn't end there.

After diving into atheism (he called himself a "hooraytheist") Holmes found new spiritual life by taking "magic mushrooms," aka psychedelic psilocybin, and studying myths and mysticism.

While walking that path, Holmes' career flourished. He toured the country as a stand-up comic and starred and produced the HBO series "Crashing," which was canceled this year after three seasons.

In some ways, Holmes' memoir seems like an outgrowth of his popular podcast, called "You Made it Weird," which veers from interviews with well-known comedians to wide-ranging conversations with Christians like Nadia Bolz-Weber and Rob Bell and Buddhist teachers such as Sharon Salzberg and David Nichtern.

Like Holmes himself, "Comedy, Sex, God" is full of irrepressible enthusiasm, a contagious curiosity for all things spiritual and healthy doses of self-deprecation. When Holmes finally meets his guru, for example, he can think of nothing except, um, pleasuring himself.

Pete Holmes appears onstage at the Vulture Festival on November 17, 2018, in Hollywood, California.

I sat down with Holmes, 40, on a recent morning in New York. He looked a bit bleary from the many media appearances he's done to promote the book, but as he pulled his long legs underneath himself on the couch -- the tall man's lotus position -- he spoke candidly about his religious upbringing and how it informs his comedy.

At times, talking to Holmes was like shaking a Magic 8 Ball filled with quotes from his spiritual touchstones, the theologian Richard Rohr, New Age-y guru Ram Dass, and even the Upanishads, ancient Hindu texts. "Finding truth anywhere -- what else are we doing?" he told me. "It's the greatest joy there is!"

This interview has been edited for length and clarity. If you want to hear the whole thing, check out Holmes' podcast . Sensitive listeners beware: Its language is a bit salty at times.

CNN: You say in the beginning of "Comedy, Sex, God" that your mother wanted you to be a youth pastor. When you told her you wanted to become a comedian she said, "close enough."

Holmes: I sort of joke that they both like public speaking, right? And certainly the type of comedy I'm doing, I would like everyone to leave feeling less afraid and less alone. I think she wanted me to be a youth pastor because I talked about the tumult in my family. I was always calming the family down or trying to keep a fight from happening. I think my mom recognized that I liked people to be happy. I like people to get along. And I like to be a peacemaker. And I liked the church. So she was like, you should be a youth pastor.

A character on your show "Crashing" calls stand-up comedians the new preachers. Do you think that's true?

I am preaching. You know, a preacher is somebody who preaches with a board of elders and like, has a text and an agenda and a religion and a group. I like saying that hopefully, I'm ministering. In the literal sense of ministry, like someone bringing soup is ministering to your body, you know. So I don't consider myself a preacher or a minister, but like, when I get on a tear and start talking about "the kingdom of heaven is here and men don't see it" -- that's just preaching. I'm sorry, I'm preaching. I don't want people to adopt my belief system and then reflect it back to me so then we can prove that we're in the group. It's totally possible to lecture passionately and verge on preaching about the nature of reality without ever going, "And now we're going to plant our flag."

At the same time, you say comedians are often cynical. How do you balance those two parts of your personality: your search for meaning and your cynicism?

You wouldn't ask for any comedian to fully detach from their ego. It's the funnier part of me, and people delight in that. And I think they take solidarity in that. They're seeing someone else sort of struggle with it.

The reason I wrote the book was to try to restore some connection (to religion), but not my belief system. To invite people as a comedian, someone who is a small part of pop culture, and say, "I don't think (spirituality) is embarrassing." I am a comedian. My brain is critical, it's overthinking, but you can find ways to turn it down and realize that's not who you really are. And I'm not saying we should all just like, melt and become indiscriminate and just like shine and everything.

So do you put a label on your religious beliefs? I hear some elements of mystical Hinduism, like your relationship with Ram Dass, but also elements of Christianity and other traditions.

I call myself "Christ-leaning," but that's primarily psychological.

What do you mean by that?

It's the symbol system I was raised with, and it got into my brain and my blood, before my discernment or anything, my defenses or whatever had grown. It just got in, in the way that your parents get in. I'm grateful for that. I'm down with Jesus, sweet Jeez, sweet baby Jeez.

But what we're talking about is symbol systems and labels. And those are good, those are helpful. (But) we're trying to get our inner reality to respond. So in the book, I'm trying to rescue some Bible verses, I'm trying to rescue some ideas of Christ. I'll always get a lot of juice out of rescuing something that Jesus said. It's healing to me, psychologically, to do that with words that were used to convince me that I was in danger of going to hell. It might be my favorite thing to do, is to go like, "Oh, my God, it was right there." We just didn't have eyes to see. We didn't have ears to hear. We were listening wrong. We were listening with an agenda. We were listening with our egos. We were listening with a deep desire for membership and identity and certainty. We weren't looking as the mystics are. And when you look at the Bible the way a mystic sees it, it opens like a flower and you're like, whoa.

And then, yes, are there my great teachers, Maharaji and Ram Dass. These are Hindu mystics, so that's in there.

Holmes stars in "Crashing," his HBO show based in part on his life.

You write about going on a retreat with Ram Dass and the two of you barely talked. What was that about?

As Ram Dass says he gets older he doesn't really want to talk about a lot of things I like to talk about, which might be like "dorm-room, smoke-a-joint" conversations that I never got to have, so I have them now. I saw him recently and just we just sat there. And it was the best.

What do you get out of that?

That's a great question. It's worth mentioning that there are countless, the majority of people maybe, that would sit and just be like, eh, seems like a sweet guy. (But) for me, it sort of feels like sitting next to a space heater. When I say he's a space heater, he's a space heater to the extent to which you're really feeling your own space heater heating up. You know what I mean? He's warming you up.

So how do you take experiences like that and integrate them into your life? Do you meditate, take psychedelics, or something else? Because it's hard to live in the world like that, no?

Because the problem is you'll seem phony, right, and I don't want to seem disingenuous.

The last time I did LSD, it wasn't deep. But all I kept thinking is that being nice is nice. And it felt like the most profound (idea). It was like you don't have to grade it. You don't have to rank it. I'll take fake nice any day, if you're one of these people who's capable of torment and torture and horror and nastiness -- and you choose nice for any reason. Good. Yeah, score.

As for meditation, yeah, I feel like I'm meditating all the time. I never stop meditating. I'm so happy to share this practice, and that's what it is, a practice. And I literally just mean "practice." I say this a million times on the podcast, like what St. Francis said, "What you're looking for, is what you are looking with." It's consciousness itself. That's the thing. That's the juice. That's what we're looking for. But it's not the cheese on the other side of the maze. It's here.

I mean, what I often find is that we don't have old people, we don't have elders, we just have old children. You know, they're just they're doing the same sh*t that I am. It's like, put the iPad down. Shouldn't you be telling me that? Why do you know what Netflix is? You should be telling me about books. You should tell me about apple trees. You should like, make me take you for a ride and then halfway through tell me that we're not going anywhere. Because that's what old people do.

But like, Ram Dass feels like an elder to me. Richard Rohr feels like an elder to me. And so much of what I'm doing here is quoting their wisdom. I'm trying to manufacture some of my own, but really, it's an amalgamation of other people's wisdom that I've ingested and gotten into my bones. But like, when you're with Richard Rohr, you're like, this is wisdom. And people know it when they hear it, and they're floored.

When you were an evangelical, did you ever convert anyone?

A very good friend of mine in junior high. We did the "Sinner's Prayer." I think he was the only one. I remember where we were. We were on this like sloping hill at night. And I just asked him if he wanted to do it. And you know, I think we were on vacation together.

Growing up, you were taught that all of the Bible is God's word, inerrant and literally true. Did you feel like you had to defend that view?

That's right, I had to ignore and turn a blind eye to other things. Jesus hates capitalism, for example, I mean, he doesn't come out and say that he hates it. But he's a champion of the poor. He makes Bernie Sanders look like a fat cat. You know what I'm saying? Like, he's out there going, "You guys are idiots, organized religion. And, and the system is a lie. And it's a thief. And it's terrible." So Jesus has been turned into something that he's not. I'm not the only person to realize this or say that. But I am not burdened by that anymore. Because a big point in the book is that I thought that the lines were to God were closed, but they aren't. We were taught that God spoke directly to his prophets and the authors of the New Testament, and then Paul, and then it was over. And then I took mushrooms, and I was like, "It ain't over!"

You write about your mystical experiences on mushrooms, how they opened your eyes to new spiritual ideas. But did you ever think "OK, this is just a result of the mushrooms?" Like, how pot makes you hungry, but there's not really any deeper meaning to it.

That's a great point, and you have to ask that question. Obviously, you go like, what does it say that there's a chemical that does this? Really, the only important question is, what is the drug doing? LSD or mushrooms plays with your consciousness. People tell me this all the time. They're like, "I don't understand. I took mushrooms. And I just saw clowns coming out of my belly button or whatever."

That sounds terrifying.

Yeah. Depends on their mood that day, I guess. But I was like, it's not necessarily what you see, it's what you're seeing with. So when consciousness is played with, it makes you aware of the play of consciousness. And there's that great TED talk about the hallucinations we're having right now that we agree on. The hallucination we agree on is what we call reality.

So what is your conception of God now, as opposed to your evangelical days?

I see God is as awareness. And it's something that we're not equal to, but that we're participating with. And the best chance we have at experiencing it and feeling it is not just having an ecstatic experience. It's finding your dignified, inherent place in its flow, through using myth, metaphor, ritual, chanting, meditation. We're trying to wake up not just to a new set of beliefs, but to our place in the river. And there's all this resistance. And that's all ego stuff. And there's all these all these, like, you know, headaches and whatever. And when we're quiet, and when we quiet that stuff down, and we can feel and identify with our piece of "divine awareness" then that's when you'll kind of find your flow.