How does saves work?

I know this is a really silly question, but I’ve no idea how to create a save game function for my visual novel (or any game for that matter). To make matters worse, I also have no idea how it would bring all of it back so (Loading a game). If there is a tutorial on here, I’d be more than happy and grateful to read it.

It’s something I’ve taken for granted over the years but never put any thought into :stuck_out_tongue: (I know bad me T__T)

I would think the basic idea would be to read/write from/to a file, however I don’t want to oversimplify something that could be rather complex. At first I thought I’d just save every single variable state the game is currently in when a user saves. ???

Thanks for the help and sorry for the ‘noob’ question.