static modifier
As long as your script has a derived class of Monobehaviour and has a static variable in it and add the script to some component in a scene, you can share the value between scenes.
I thought it would be better to show the visual aid.
As seen in the image, the "Score.cs" has a variable "score", which is 0. The value could be shared between scenes. Obviously there are other ways to do the same thing, but I just thought my way is easy, and understandable for beginners just like me.