The 35-year-old ex-Spain international, who made almost 400 first-team appearances in almost 25 years at the Bernabeu, has been without a club since leaving Besiktas in November.
In a statement published on marca.com this evening, he said: "The decision has been made.
"I have received offers but I've decided to stop. I can now spend more time with my family.
"I'm going to train to become a sporting director or a coach and I'd like to train youngsters.
"I'd really like to coach the Real Madrid youth team. That's my dream."