In standard terms you just want to beat the level. Rings are like a bunch of second chances but also contribute to your score which carries the tension of risk the more you get. The levels are multifaceted, with the high road usually being considered the harder/faster route, and exploring what the levels have to offer yields things like power ups, secret paths and bonus stages where you can collect Chaos Emeralds which are like this game's version of the super secret collectible. It's not really about getting to the end of the stage as quickly as possible, but because of the mechanics of the game, it heavily encourages you to go fast and employing the mechanics of speed in order to access additional areas, which is part of the reason why the best Sonic games are built to be just as good for platforming as they are for speedrunning, even if many games sometimes end up prioritizing one over the other. The Genesis games, and Mania, strike the best balance and are more crafty when it comes to this.
2D Sonic games are heavily contingent on rolling. This is going to be your main move throughout the game. When you're faced with slopes and inclines you want to roll in order to build up proper momentum and go even faster than you would if you were running. Rolling also protects you against enemies that may be in your way or destructible obstacles. If you can learn to pull that off well, you'll be able to go fast while also going safe.
The caveat of course with rolling is that you sacrifice control and that you also have to perform it on proper areas, as well as already having inherited momentum, to maintain your speed, or else you'll grind to a halt, so while there is some risk with it, there's more reward when done right and you can trust that rolling is your "safer" state so to speak most of the time.
Mania also helps finally give Sonic a unique incentive of playing by giving him the Drop Dash which is a fantastic ability that can maintain momentum whenever you feel like you need to regain momentum after a jump.
Basically, learn to use the level design as a tool and applying Sonic's pinball-esque physics for going fast.