How can create a updating coin counter. Where it will continuously keep updating the amount of coins i have collect after playing a level multiple times

please reply?

I think Game State is the key, since the game state keeps it values even if the game is restarted or the level changes.