Checkpoints in 2D game

I want to know how to make the checkpoints(respawn points ) and endpoints of a 2D game.

thanks in advance