Checkpoints…

I have been working on a new game and I have multiple levels, but every time I die, it brings me back to Level 1. Please could you reply to this and send me the exact code on how to make checkpoints? It would be much appreciated