How can I stop and restart my music?,How can I stop and restart the music in my game?

So, I’ve already previously used DontDestroyOnLoad in my game in order for the music to seamlessly switch between my main menu and game scenes. However, once the game is over and players click the “Back to Menu” button, my previous music continues to play while a second layer of the same music starts to play on top of it. How can I stop the previous music so that they do not overlap? Is there a way to reload the audio mixer?

public class DoNotDestroy : MonoBehaviour
{
void Awake()
{
GameObject musicObj = GameObject.FindGameObjectsWithTag(“Music”);

    DontDestroyOnLoad(this.gameObject);
}

}

Go to your button that will take you back to the menu and scroll down to find the + and add an event.
(this is the same add event button that you used to place the script in)

Drag in the object (the one with the audio component)

Under events, find the gameObject audio source and find .stop and choose that.