It depends on your system, or rather your game engine. If your using simpler engines that doo everything, such as renpy or rpgmaker, you need not do anything, the engine does it for you. But if you want a more technical answer, then I'll assume you're justing coding things raw.
Say for example, unity.
In unity, to have data move across scene to scene, you need to make an object class that is a 'singleton,' something that can only exist one at a time, so once it is made, it move from scene to scene, holding all the data. This is able to track things like, if you want to have a character inventory, it always remember what it has as different scenes are loaded. This is just because unity has a scene to scene mentality, and I find it annoying. But what one of these singletons can be is your save data. an object that keeps track of things to remember as the player moves scene to scene.
One of the things you want to do is also make this a [Serializable] class. What you can do is open a data stream (aka create a file of any kind, such as a "Save01.mygamesave" file type), and what you can do is you have your save data as a object class of some type, with a pointer to it you can serialize it. Serializing is when you take a 'object class' and convert it from running code to straight up just a picture of the object and all of its data at any given moment, a picture of pure binary data. What you can then do is do a binary write to the data stream (to the file), and that file (whatever name you give it) is litterally just a picture of your save data object at any possible state.
to load a save, you would have open a data stream again, pick the file you want, read it as a binary file, and then convert the binary into working code by deserializing back into the save data type class object again, which the code can then figure out how to set the game based on the state in the save data class.
but that may sound complicated depending on if your dealing with raw code or not, more information about your situation would help.