Teleporting player to stored location

If I want to be able to store a player's x/y/z position, then teleport them somewhere else, and then teleport them back to the stored location, what would be the best method? I've tried storing the player's coords to scoreboards using /execute store (which worked), and tried to store them to "nbt storage" but couldn't get that to work. I imagine I'd need to use data modify entity to teleport them back, but couldn't figure out how exactly I'd do that. Preferably I'd do this without the use of macros, so that my pack can work on older minecraft versions. Let me know if you need any more info from me :]
Continue to help post