The England defender, who was heavily linked with a move to Real Madrid, was persuaded to stay by manager Carlo Ancelotti.
“It was hard for me in my head,” he told ESPN. “It wasn’t just about the football, it was more my brain and it was getting too much for me.
“There were times when it was really hard. I did think about leaving but, of course, when I spoke to Ancelotti he made it clear he wanted me to stay and loved having me around, and the players didn’t want me to go.
“I’m glad I stayed. A lot of people were saying ‘you can’t leave’, ‘he’s basically giving up and he has to take the flak’.
“I’ve stayed now and I’ve taken the flak and hopefully I’m coming through it.”
“I would love to end my career here,” added the left-back.
“I’d like to say I have four years left at the top, but I’m taking it year by year and seeing how the body is because I’m 29 but I feel like 35 or 40. It’s hard getting up in the mornings.”