If relevant, I ask them what is inspiring this decision. Sometimes, it's not having the spoons anymore. Sometimes, it's a matter of needing to keep their schedule open (I won't say specifically why, that's personal). Sometimes, it's "I'm glad I joined, but this isn't for me." And sometimes, it's none of my frelling business, and the player says so (much more politely, but still).
If the problem is something I can fix, I am happy to try. My highest goal is--always--to foster genuine enthusiasm in my players. If they aren't at least a little excited to play, I've screwed up.
I haven't ever had a bad breakup. One player that was getting kinda iffy chose to depart the game for personal reasons, but otherwise, every other player that has departed has done so for entirely reasonable reasons. Many have even expressed the hope that someday they might be able to return, though that has only happened rarely, I'm afraid. One player did me a truly great honor. He had been in a number of campaigns, in part as some self-therapy for getting over a bad breakup. But my game, he said, was the only one among them that was hard for him to leave.
That was the moment I truly knew, "Yeah, I've done a good job as GM." It meant a lot to me for him to say that.
But that isn't really relevant for you. You have a player who, it sounds like, just needs to step away from TTRPGing in general right now. That's not a knock against you. Your best choice, IMO, is to be supportive. That both gives the best chance that they'll want to come back, and the best chance that even if they don't, you'll show them that their participation mattered because of them, not because they were in your game.