Rafiq said that he has struggled to reach his usual standards this summer following the devastating loss of his unborn child.
In a statement on the club’s website, Rafiq thanked those who have sent good wishes to himself and his wife, Faryal, and hopes that by opening up it will encourage others to speak about their challenges.
“It has been an extremely tough time for our family to endure over the last 14 months,” he said.
“My wife Faryal experienced a very trying and difficult pregnancy. As we approached the final few weeks of her pregnancy, things finally started to settle down, until I received a phone call from my father during our 50-over match against Warwickshire at Emerald Headingley confirming my worst fears and the devastating news that my unborn child had passed away prior to his birth.
“Throughout this traumatic time, my wife Faryal has been an absolute hero and I cannot thank my close family and friends enough for their love and support, it means so much to both of us
“I feel like now is the right time to explain the reasons why I was unable to attend the club’s pre-season tour and why I have played very limited cricket throughout the season.
“I have tried to give 100 per cent whenever I have stepped on the field although I have found it difficult to maintain the usual standards of consistency that I set myself.
“Hopefully this addresses some of the comments or questions that I have received on social media this season regarding my situation and I am hopeful that by taking some time off with my family I will be able to return to cricket as soon as I am refreshed and equipped to get back to playing and training as normal.
“I would like to say a huge thanks to everyone who has reached out with messages of support during the season, it has been greatly appreciated by my wife and I.”
In an earlier press release announcing his departure, Yorkshire said that it was not possible to offer Rafiq a new deal.
Director of cricket Martyn Moxon said: “Obviously this is part of our rebuilding process. We’re having a really close look at areas in which we need to strengthen the squad and, crucially, within the budget we’ve got.
“Unfortunately, with that in mind, we’re not able to offer Azeem a contract extension.
“We wish him well for the future and thank him for his contribution to the club over the last three years.”
Rafiq, who first represented Yorkshire in 2008, was released at the end of the 2014 season due to a loss of form and confidence but rejoined the club in 2016.
Many of his finest moments came in T20 cricket, where he formed an often devastating partnership with fellow spinner Adil Rashid.
Rafiq, 27, stood in as captain to help Yorkshire towards T20 Finals Day for the first time in 2012 and recently took his 100th wicket in the 20-over format.