You've reached the game's final stage, which actually winds up being one of the easiest. That's especially true if you brought along at least two E-tanks and plenty of special weapon energy.
From the entrance, the only way to go is down. Drop down the vertical shaft and hold to the left if you need to refill your special weapons (though you're better off simply losing all of your lives on purpose and then continuing with a fresh refill, if that's the case). There is a cannon resting in a nook to the right, so try not to let it damage you as you collect your item and then drop once more.
Now you'll be able to head to the right to find one of the machines that dispenses hardhat enemies. If you need to, you can keep shooting them as they appear, one at a time, to collect items they drop, but that feels mostly like a waste of time. When you're ready, take out the dispenser and head right to collect an item from Fliptop. Then you can pass through the gate to face off against Dr. Wily, in a three-round battle.
Equip the Silver T. weapon, which you'll want to use first. Dr. Wily is riding in a well-armored skull pod. It has spikes along its base, and fans and cannons along its sides. The first thing it likes to do is spring toward you, and it moves pretty fast. Slide under it, then face left and fire a tomahawk or two in its direction. Be ready for it to hop back to the right. You'll need to keep sliding to avoid those attacks, which do real damage if they connect. Periodically, it will also send four energy balls out from its sides, so be ready to jump over those.
When you have hit the pod a few times with the tomahawk, the shielding will come away and you can finally see Dr. Wily, through a panel. His energy meter refills, and he continues attacking in the same basic manner. Just keep hitting him with tomahawks and you'll make short work of the meter.
Now it's time for the final phase. Dr. Wily will disappear from sight, but his pod will reappear on occasion, long enough to launch a whirling set of four energy orbs. These start to spin in a circle, and then the closest one will fly toward your location. So be ready to jump that and avoid it as you charge your arm cannon. Sometimes, Dr. Wily will appear at about your level, so you can hit him with a charged shot. Other times, he's out of range and you just need to avoid him. But if you last long enough (this is where the E-tanks are potentially useful), you will eventually do enough damage to put Dr. Wily down for the final time.