The final boss in Sonic Mania can be beaten by following these steps:
1. Get to the top of the arena as fast as possible. You can do this by either using the ramps or by jumping up the ledges on the sides of the arena.
2. Once you're at the top, wait for the boss to attack. He will usually charge straight at you, so be ready to dodge out of the way.
3. When the boss is open, jump and hit him with a spin attack. He should be stunned for a moment, giving you an opportunity to hit him again.
4. Repeat steps 2 and 3 until the boss is defeated.