I am wondering how to save a int in the background

Hi, I have been trying to make an incremental game. I just started making it, but cant figure out how to save my score in the background. I have tried useing DontDestroyOnLoad(gameObject); , but this only returns with “DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.”
I can not figure out how to fix this. I have some ide what roots are, but i dont know how it works. So my first question is what is the root?

my second question is how do i save my score.(My game works with a button getting pressed, and a number going up. This nuber can go up for example 2 /sec) So i am wondering, how do i save this number in between scenes?

Firstly, A root gameobject is a gameobject with no parent.

Secondly, for data to persist between scenes, you’ll need to save it in a file somewhere. This official unity video has a section on saving and loading data between scenes.

You could try using PlayerPrefs.
Check PlayerPrefs.SetInt for example.