How to create a scoring system and a highscore system for an endless runner?

I want to make a scoring system where you get points for how far you traveled and how many coins you collected. I also want the game to keep the highest score and for the player to type their name in. Any idea how to start it?