So you want to handle save games ?
Most games once reaced a certain size will need to persist data between game sessions. In our game dev jargon, we call this data a Save Game.
Your first reflex would be to think: oh this is easy, we only need to find the user's documents or data folder and use simple file read and write operations to handle the save data.
Assumming we are using the Zig programming language, our favorite here at Cold Bytes Games, and the library known-folders, a naive save game serialization code could look like this (this code has not been tested).
const known_folders = @import("known-folders");