Dyer joined the long-running BBC soap in 2013 as landlord of the Queen Vic Mick Carter and announced he would be leaving the soap at the start of this year.
The 45-year-old has since revealed he needed to take a break from filming after “losing the plot”.
Speaking on Jaime Winstone’s new podcast, Greatest Night Ever, he said: “I turned around to the bosses of EastEnders and I said, ‘Listen, I’ve gotta go somewhere. I’m going to die’.
“They was like, ‘Oh, OK. Uh, right’. And so I sorted it myself and I paid for it myself.”
Speaking of his problems with fame he continued: “Fame never suited me. I was always f***ing gonna be going down the wrong path. So I lost the plot for many years and I was a f***ing lunatic.
“I became a sort of a cartoon character. I created it myself, don’t get me wrong […] I got wrapped up in that and I sort of lost who I was, really.
“I was doing s**t loads of f***ing drugs. I was searching for something. There was a hole in me and I couldn’t work out what the f**k it was.”
Door left open for Danny Dyer to return to Eastenders
Speaking about his character’s exit, he said: “Let me tell you something now – Mick’s exit is going to be a very, very powerful thing. I would love the door to be left open, and as far as I know it is.
“So, who knows, when I go out there and I fail miserably I can come back with my tail between my legs and go ‘Will you take me back?’”
He said he is sending “love to everyone at EastEnders”.
BBC issues statement as Danny Dyer quits Eastenders
After his news of his departure broke earlier this year, a statement from show bosses said: “Danny will be leaving EastEnders when his contract comes to an end later this year.
“Danny has made Mick Carter an iconic character, which we shall always be grateful for; however we won’t be saying goodbye just yet as there’s still quite some time – and plenty of explosive drama for Mick – to come before he departs Walford.”