Mecha Ridley
Mecha Ridley is split into two phases each with their own health. The first phase is with the glass covering his weak spot which takes 10 missiles to break, or 2 super missiles. Once the glass breaks he'll enter his second phase which takes another 18 missiles, or 4 super missiles, to finish him off. If you've collected 100% of the items before starting the fight, Mecha will have triple his health on both phases and deal double damage.
Mecha has 3 attacks which he can do in any order and sometimes do 2 or even all 3 attacks simultaneously. He can swipe his claw at you, he can fire 3 missiles off his back which track samus, or he can spit fireballs. Once you've broken the glass on his chest and enter the 2nd phase of the fight, he will no longer spit fireballs but instead fire lasers out of his eyes.
Any%
In any% you should have at least 6 super missiles for Mecha. The main idea is to fire all 6 into his weak spot to kill him as fast as you can, which there are safer ways and riskier but faster ways to do so. The fastest way to kill him is to do a full jump right before the music starts, this causes him to raise his head and expose his weak point faster. Then fire all 6 supers in rapid succession to immediately kill him. This strat is risky because there's a random chance Mecha will do nothing and let you kill them, and also a random chance he'll swipe or spit fireballs and cause you to miss your supers. This is known as the YOLO kill because of the risk involved.
The Controlled YOLO kill is a similar but safer strat where you start the fight in the exact same way but only fire 1 super missile. If you pause for a second after the first shot, mecha will be locked into one of 3 patterns which you can then react to. He could either immediately swipe, he could wait a second and then swipe, or he could spit fireballs. Once you see what he's doing you can safely fire the rest of your supers while reacting to his attack.
If the initial jump to start the fight is too hard to get down, the safest way to fight mecha is just to stay crouched in the corner and wait for him to swipe his claw and raise his head. This is a random chance for how long it takes him to do this, so you could get a pretty quick fight if you're lucky or you could be sitting there for 10+ seconds waiting for a swipe. This is the safest strat because once he swipes you're pretty much guaranteed to have a long enough opening to kill him with all 6 supers.
100%
The 100% fight is exactly the same as any% except it's going to take 6 supers to break the glass and another 12 to finish him off, so 18 supers total to kill mecha. You can do a similar YOLO strat to try and kill him as fast as possible if you're feeling risky like so:
Or you can always take a safer approach and fire a few supers to start the fight and wait to see and react to what his attacks are. In 100% you should have full health and plenty of ammo to eventually kill him.
9%
This is one of the toughest fights in a 9% run. The best advice for this fight is to practice practice practice and get used to all of his attacks and patterns and know how to dodge them. If you can be comfortable enough to just sit in mecha's room and hang out with him without getting hit by any of his attacks, you can eventually kill him. There are a lot of small nuances to Mecha's behavior that don't really matter in any other situation besides the low% fights:
If you stay against the left and crouched, his claw can't reach you so you're completely safe from the claw attack by itself. You can usually shoot all 3 missiles he'll fire at you from this position, but sometimes they'll swerve at you in a way where you need to jump and fire straight down to dodge them. This gets tricky if he swipes and missiles at the same time because you'll need to time your jump to either be above the claw before it swipes, or jump after the claw is on the ground. Another thing to watch out for is if he swipes right before the missiles reach you, his claw can overlap the missiles and prevent you from shooting them. In this case you'll want to jump after the claw is on the ground and shoot the missiles as they swerve underneath you.
You may notice Mecha is slowly crawling towards you during the fight, especially when he swipes. If you hit him with a missile, he'll back up away from you. This becomes important during the 2nd phase with his laser eyes because it's easier to dodge the lasers when they're farther away.