playerprefs help i can't get it to work

So i wanted to save my slider settings. When i go to another scene. But i looked at a playerprefs tutorial but idk how i can use it. So it needs to be that it save the position of the slider and the sound when i go to another scene. And when i go back tho my optionsmenu scene thats its the same settings. Also somewane said i also can use don’tdestroyonload but i cant figer out how tho use those things. So if you can help me out it will be great. If you could please add the playerprefs to it and make a post below. Sorry that i ask for that but i am createing my first game and i dont get some things to work. best regards Xavier

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

public class MusicPlayer : MonoBehaviour
{
    // Start is called before the first frame update
    public AudioSource AudioSource;

    private float musicVolume = 1f;
    void Start()
    {
        AudioSource.Play();
    }

    // Update is called once per frame
    void Update()
    {
        AudioSource.volume = musicVolume;
    }

    public void updateVolume(float volume)
    {
        musicVolume = volume;
    }

    void Awake()
    {
        PlayerPrefs.SetFloat("musicVolume", volume);
        PlayerPrefs.GetFloat("musicVolume");
    }
}

You need to call SetFloat whenever the value changes, presumably in updateVolume.

In Start or Awake, you need to use GetFloat to assign the slider’s value. Something like:

public Slider slider;
void Awake() {
slider.value = PlayerPrefs.GetFloat("musicVolume");
}

(For future reference - PlayerPrefs is good for exactly that, prefs. A common mistake by rookies is to try and make PlayerPrefs work with more complex data and saving the game with it, which it is not meant for. When you get into the point of saving actual game data which is more complicated than preferences, you should quickly ditch PlayerPrefs for a more robust system, which will as the data gets larger actually become much easier to use than PlayerPrefs. When that time comes, some good terms to google for tutorials would be serialization, JSON, and BinaryFormatter)

And how can i add that ? bacause i a new to playerprefs and have no idea how to add

public Slider slider;
void Awake() {
slider.value = PlayerPrefs.GetFloat("musicVolume");
}

to my script sorry if i ask to mutch

I’m not sure how I could simplify it any further than that…