The Sex Pistols singer took drugs to try and keep him awake as he was terrified about falling asleep and then not being able to remember anything when he woke up the next day after losing his memory after a serious case of meningitis when he was just seven-years-old.
Speaking in his new The Public Image Is Rotten documentary, he said: "There was just too much temptation. There was a lot of that cocaine floating around which can screw up a lot of things. That was a hard one to walk away from.
"For me, it’s things that keep me awake which are the things I’m interested in. The longer I’m awake the less chance of waking up from a sleep not knowing who I am. I never, ever want to go through that period of being in the hospital and not knowing who I was again."
Meanwhile, John previously revealed how he is a full-time carer for his wife who has dementia.
He said: "Nora has Alzheimer's ... I am her full-time carer and I won't let anyone mess up with her head. For me the real person is still there. That person I love is still there every minute of every day and that is my life. It's unfortunate that she forgets things, well, don't we all?"
And 64-year-old star - who married German publishing heiress Nora in 1979, and became stepfather to her daughter, The Slits singer Ari Up - first revealed his wife's diagnosis last year.
Now, he has compared her condition to a "permanent hangover".
He added: "I suppose her condition is one of like a permanent hangover for her. It gets worse and worse, bits of the brain store less and less memory and suddenly some completely vanish."