It's rather simple, really. Within your game's main loop, you can have a certain button lead to another loop, which is a pause loop, in which you can do anything you want the pause to do until you unpause it. Unpausing is probably even simpler, since all you need to do is exit the pause loop and carry on with the game's main loop.