scipt value changes while InGame forever

Hello code Ninjas!
I was looking for this several days but cant find a proper tutorial for what I need.
I want to have public int something =5; in game actions change the value of 5 to 7 and when I close and open the game it must stay 7.Something like saving this value and changing it into the script.
Thanks for you time!

Is 7 set as a value in Unity Editor?

Is it changed anywhere in your code? If yes and it is buggy, add logging around it.

You just need to set the value in Start or Awake. Depending on what “something” is, you could simply save it’s value to a playerpref when the player performs their action and then you load up that value when the player loads the game. Playerprefs also have a way to declare a default value so it gets set to 5 if it doesn’t find the playerpref (thus the first time the player runs the game). There is no way to permanently change the value if the user uninstalls and reinstalls for example unless you were to have an account for the player and saved the change online once it changes to 7.