Pause System not working :/

I have tried many ways for my code to work and it is honestly a headache at this point any new codes or issues to fix my code would be extremely helpful. I have no idea what is wrong with my code but it is not working almost at all and yes I have everything set up in unity for it to work I believe it is with this code or the sample code Unity uses for my player controller. Here is the code thanks in advance for the help if you do try to help <3

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

public class Pause : MonoBehaviour {

public static bool gameIsPaused = true;
public KeyCode pause;
public m_MoveDir PlayerMove;
public GameObject pauseMenuUI;

public class m_MoveDir
{
    internal bool enabled;
}

private void Start()
{
    pauseMenuUI.SetActive(false);

    if(SceneManager.GetActiveScene() != SceneManager.GetSceneByName("menu"))
    {
        PlayerMove = GameObject.FindGameObjectWithTag("Player 1").GetComponent<m_MoveDir>
        ();
    }
}

private void Update()
{
    StartCoroutine(Wait());
}

IEnumerator Wait()
{
    if(Input.GetKey(pause))
    {
        if (gameIsPaused)
        {
            yield return new WaitForSeconds(1 / 4);
            Resume();
        }
        else if(!gameIsPaused)
        {
            yield return new WaitForSeconds(1 / 4);
            Resume();
        }
    }
}

public void Resume ()
{
    pauseMenuUI.SetActive(false);
    Time.timeScale = 1f;
    gameIsPaused = false;
    PlayerMove.enabled = true;
}

void DoPause ()
{
    pauseMenuUI.SetActive(true);
    Time.timeScale = 0f;
    gameIsPaused = true;
    PlayerMove.enabled = true;

}

public void LoadMenu()
{
    SceneManager.LoadScene("menu", LoadSceneMode.Single);
    if (gameIsPaused)
        if(gameIsPaused)
        {
            pauseMenuUI.SetActive(false);
            gameIsPaused = false;
            Application.Quit();
            SceneManager.LoadScene("menu");
            Time.timeScale = 1f;
            PlayerMove.enabled = true;
        }
}

}

@xxmariofer
You pause then it unpauses after 2 seconds…

ANYWAYS

Look if you want to create a pause menu it is simple!

using UnityEngine;

public class PauseMenu : MonoBehaviour
{
    public GameObject pauseContents;
    private bool isPaused = false;

    private void Start()
    {
        pauseContents.SetActive(false);
    }

    private void Update()
    {
        if(!isPaused)
        {
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible = false;
        }

        if(Input.GetKeyDown(KeyCode.Escape))
        {
            Toggle();
        }
    }

    void Toggle()
    {
        isPaused = !isPaused;
        if (isPaused)
        {
            Time.timeScale = 0;
            pauseContents.SetActive(true);
            Cursor.lockState = CursorLockMode.None;
            Cursor.visible = true;
        }
        else
        {
            pauseContents.SetActive(false);
            Cursor.lockState = CursorLockMode.Locked;
            Time.timeScale = 1;
        }
    }
}

Now in every script that needs to be paused, just put this at the start of any Update() function

if (Time.timeScale < 0.2f)
            return;

Your welcome!

you are doing it in a really extrange way, test this code just overriding your update and corroutine

private void Update()
{
    if (Input.GetKey(pause))
    {
        StartCoroutine(Wait());
    }
}

IEnumerator Wait()
{
    DoPause();
    yield return new WaitForSeconds(2);
    Resume();
}