Out of all the Bosses you will face during your journey with Mario, the Ruined Dragon will no doubt be the toughest you will face. The battle will begin with the Ruined Dragon casting down lightning bolts down upon you, ones that emit curved blades as they hit the ground. Avoid the lightning strike by following their shadows. After several strikes, the dragon will slam its head straight down onto the arena, creating shock waves of lightning that will spread out in all different directions. Quickly and continuously jump to avoid them until they fade away.
After doing so, you will see several swords embedded in the skull of the dragon. You'll need to pull them out in order to take away the chains that guard his helmet, so quickly hop on his skull and pull out as many as you possibly can. If you are quick enough, you can take off his entire helmet in one go and then ground-pound to cause damage to the beast. If you don't finish it in one attempt, make sure to jump off his head when you see him start to flicker so you don't get electrified. If this happens, simply wait until after the next wave of attacks to try to finish off the job. If any Spinies try to block you along the way, use Cappy to sweep them away.
After dealing damage to his head, the Ruined Dragon will retaliate by firing more bolts with all the more rolling blades in order to hurt you. He eventually slams his head to the ground again, sending even more shock waves this time around. The waves will also have ripples in them to increase the difficulty in dodging them, but it can still be done with perfectly timed jumps. Do the same as before after this, removing the swords on his head to remove his helmet and land another ground-pound.
In the final phase of the battle, the dragon will shoot a spread of lightning blots in a row, each exploding into more rolling blades that will further attack you. After this, he'll again slam into the ground, creating shock waves with even more intersecting waves. After successfully dodging them, you will have to pull out even more swords from his skull. Don't worry if you can't get them all in one attempt, as he just continues the same set of attacks. After removing his helmet for a third and final time, land one more blow to his head to defeat him.