using Scenemanager

I’m new to coding as it is, then when i find out i have to use this whole “scenemanager” i am literally pulling my hair out trying to work it out.

Basically i have a pause menu in the game which functions however, i want to be able to go back to the main menu of the game using it. so i am trying to load the scene and close the current one if the user presses the button.

public static void LoadScene() {

	//SceneManager.GetActiveScene (mainMenu);

	if( SceneManager.GetActiveScene(mainMenu).buildIndex==1 ) {

	print ("To main Menu");


Excuse the “messiness” of it.
The main menu scene i want to go to is called “mainMenu” if that helps.

I Honestly have no idea how to do this. Any help would be appreciated.

How about this: