And you shouldn't worry about it anyway - unless you're making an online game, who cares if the player gives themselves a bajillion health?
Exactly and at that point you would be storing your saved data in database.
There are many ways to save data and from the sounds of it you are a beginner. Saving to a text file is a good place to start. Even though saving to a text file is expensive, if you are not making a huge AAA game then it really shouldn't matter.
Might also be worth looking into different text data formats like json and xml.