U blundered a move and it caused checkmate
How did my Opponent win??

I am new. but I don't understand how my Opponent wins sometimes when I am ahead?? It said I was ahead by +9....all of a sudden, the game ended and 'white won'.....What the heck is happening!
You were winning in all aspects, but the most important one. The clock. This take has now been exposed

Most likely you ran out of time thus causing your opponent to win because of the clock. Yeah, it sucks when you're winning and run out of time but that's just the game.

so what does that mean? that it was my time to move when the clock ran out? if that is so, what is to keep your opponent from just waiting til one second is on the clock and making their move, so that even if you are ahead, the clock runs out on you? I am new so thanks for help.

You only have a certain amount of time to play the entire game. Each player's time is tracked seperately... your clock only runs when it's your move; your opponent's clock only runs during his move.
If you run out of time, you lose automatically (or draw, if the opponent has only a bare King left).
Either move faster, or play slower time controls... Rapid instead of Blitz or Bullet.

I too forgot to hit my clock in first OTB tournament. Must have happened 10 times Lol. My opponent kept shooting me looks though, so never hurt too bad.
Also a fun time keeping fact, tho not about chess hahah. I just learnt yesterday that when soccer (football) first started to be played, they didn't have clocks that could start and stop easily.. that's why there is no stop time, and extra time is added at the end.. they just stuck with old school! 50% off topic sorry
I am new. but I don't understand how my Opponent wins sometimes when I am ahead?? It said I was ahead by +9....all of a sudden, the game ended and 'white won'.....What the heck is happening!