How can i save values over scenes

I made my first game, it is a rip off of flappy bird and want to make a highscore that needs to be saved over the scenes. Since when my bird dies i reset the scene.
The problem is:
NullReferenceException: Object reference not set to an instance of an object
SharedR.Start () (at Assets/SharedR.cs:12)

So how can i save values over a scene, since i cant make code in another scene to prevent it.
SharedR is in another scene

Code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SharedR : MonoBehaviour
{
    public int Highscore;
    public logicscript logic;

    void Start() {
       
        logic.playScore = 0;
    }

    // Update is called once per frame
    void Update()
    {
        if (logic.playScore >= Highscore && logic.playScore > 0)
        {
            Highscore = logic.playScore;
          
        }
        Debug.Log("Highscore: " + Highscore);
    }
}

and:
public class logicscript : MonoBehaviour
{
public int playScore = 0;

public void addScore() {
playScore++;
scoreText.text = playScore.ToString();
}

public void restartGame()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}

Lots of ways to do this. Many people start out using player prefs. This has the advantage of being very quick to set up and test, and the data persists between sessions.

As your game scales, you might need something more flexible. A good option is to use scriptable objects to hold data that can be referenced within different scenes. Scriptable objects live in the project, so they are great containers for shared data. Just be aware that if you want the data to persist between sessions of your game, you’ll need to save it to a file and restore it later.

https://unity.com/how-to/separate-game-data-logic-scriptable-objects#:~:text=ScriptableObjects shine when many objects,values individually on every GameObject.