how do I to write script to close and restart a game

I want to add some button and a picture as background and some voice to game over UI .show me a example