If you have undoing in your game, you can kill the player and let them undo. If not, you can have checkpoints, so the player resets to a not-so-far-back point in the game. If neither option is viable, you can teleport the player to a reset button upon "death", and change the player sprite to a selector on a reset button of sorts. Have the player locked there until they press the action key, then reset the level manually. Lastly, you can just reset the level by yourself manually a few moments after the player has died. I'm being deliberately vague about specific techniques because these vary drastically depending on what you're trying to achieve, and what type of game you're making.