Prying is socially hostile and should be responded to as such.
In certain cases of ongoing, and contentious, relationships, sooner.
Realize that the other person is free to ask anything they want, but just the act of them asking doesn't create any obligation on your part. Especially with people where you don't have a longstanding relationship, you don't owe anyone anything more than a polite no.
The other piece I learned was this useful phrase to deploy when under severe pressure to give a reason and for whatever reason you can't just disengage or leave: "Sorry, I'm just not comfortable with that". No one can reasonably argue with that, and if they do, having already given your reason you can then simply fall back into a loop of "No, sorry."
It's like going to knife-fighting class to learn how to win every knife fight and receive "buy a gun" advice. Yes, it works. But it's not really a knife-fighting skill, is it?
WRT GP's comment, what they described is communication. It's precise communication. Saying exactly what you mean and nothing more. Not falling to some kind of instinctive save-face pressure and inventing a bullshit reason, that only leaves you worse off (you now either have to defend from your interlocutor's attempts at helping you, or admit that you've lied).
(To use a knife-fighting analogy, it's like learning to thrust without making it easy for your opponent to dodge your attack and cut you up.)
Just simply say "no, sorry"
Once you start giving your reasoning, the other side can negotiate a compromise or attempt to persuade you into thinking your no is a bad idea. The more information you provide, the more they can use it against you.
If you don't have time for that, just end it at no and say no more.