Restarting Scene/Level

Hi, I’m begginer and i have problem.
I want restart my scene. I have one Scene (“MainScene”) and when a player dies i would like to restart game.

I tried used :
Application.LoadLevel(0);

SceneManager.LoadScene(0);

and both work but when i press space it automatically restart my scene and here is my problem, why space button is restarting my scene?

public class CanLose : MonoBehaviour
{

public MobControler[] mc;
public Canvas loseMenu;

void Start()
{
    loseMenu = (Canvas)GetComponent<Canvas>();
    loseMenu.enabled = false;
}

void Update()
{

    for (int i = 0; i < 42; i++)
    {
        if (mc*.zdrowie <= 0)*

{
loseMenu.enabled = true;
}
}
}
public void TryAgain()
{
loseMenu.enabled = false;
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
Time.timeScale = 1;
SceneManager.LoadScene(0);

}
}
It’s my code and TryAgain function in project is a text button.
And after press TryAgain it should reload my scene (game) and it does but when i press space it reloads too. So here is code where I use space button:
public class PlayerControler : MonoBehaviour
{
public CharacterController characterControler;
public float height_jump = 7.0f;
public float cur_height_jump = 0f;
void Start()
{
characterControler = GetComponent();
}
void Update()
{
keyboard();
}
private void keyboard()
{
if (characterControler.isGrounded && Input.GetButton(“Jump”))
{
cur_height_jump = height_jump;
}
else if (!characterControler.isGrounded)
{
cur_height_jump += Physics.gravity.y * Time.deltaTime;
}
Debug.Log(Physics.gravity.y);
}
}