Hold a nut while unscrewing?
Without any sort of picture, one technique that has worked for me is to pull on the screw to pull it out and then rotate gently - friction between the nut and its surface then allows the screw to come undone.

Tricky part is getting the “best” amount of pull compared to rotate. If it was cross-threaded then you are out of luck, see the next bit...

If all else fails, you will probably end up drilling the head off the screw - good luck.