In Super Mario World 2: Yoshi's Island, you get familiar with the boss shtick pretty quickly. You work your way through a castle, and at the end Kamek appears and makes a common enemy real big, which you then have to fight. The enemy at the end of World 3 is pretty obviously going to be a Piranha Plant.
So you make your way through the twisty and turny passages and eventually make your way to the boss's room, and you can see the little plant over on the far right. Just kind of ease into the room. If you get too close, the fight will start, and we don't really want that.
If you get the plant just on the screen, try throwing an egg at it. If your aim is any good and you can smack it, you'll defeat it with one hit, surprising... well, everyone.
You can also stand just on the edge of the platform to make the egg-throwing easier, but I tend to walk over too far and get the battle started when I do that, which isn't that hard or anything, but this is much easier.