How do I use firebase to save and display a leaderboard with username and score?

That seems like something you should address with your teacher. Do you have to use Firebase? It’s much easier to use Google Sheets or Airtable.

If you do need to use Firebase, you do so with cloud variables that have the name of the Firebase path to the value(s). You can see some examples here and here.