That's a universal problem without a universal solution. Which is to say, all of the above anecdotes, suggestions, and potential solutions are welcome. But, the frustrating part is each case is different and there are no guaranteed non-destructive solutions whatsoever.
Which is a place we don't like to be, especially situations where failure will result to dead in the water. If you luck out and tease them apart today, no guarantee that they won't be hopelessly frozen tight tomorrow at 3am, on a perfect night, at your dark site, two hours from home.
Threaded fasteners are ill-conceived right out of the blocks. Convenient and simple-minded... but conceptually-flawed. Consider this: You screw them together to precisely attach the two parts via the matching male/female threads. You have to get it tight enough to hold, yet loose enough to not hopelessly jam, gall or damage. Too loose and it might fall apart, too tight and it might weld forever. So, you are entirely relying on guesstimated friction... That could be a cheap bottle cap or a $20K camera, still held on by nothing more than "hand-tight". And, as noted above... temperature, humidity, atmosphere, pressure, even just time... can hopelessly loosen of tighten.
Some fancy rotate-on fasteners comprise mechanical "phase-change" mechanisms to overcome the above problems. Many camera lenses have the bayonet that clicks when engaged and locked. And release with e.g. a little push-button. I recall, with some exasperation, that the Zuiko and Nikon lenses had opposite directions. And one failure mode of the Zuiko was that the release button would fail stuck on. Only way off was a sledge hammer. The picture below is ... I think it's a Nikon lens. Even the best brands sport ultra-cheesy mechanical fasteners. Tom