how to make a functional pause menu

i can’t tell but would this also work for other game modes?