"What's a Mario character doing in a Zelda game? Getting skewered instead of stomped, apparently, because they are an easy target for your Sword."
Link's Awakening guide

Goombas are enemies from The Legend of Zelda: Link's Awakening. Mushroom-like creatures, Goombas are originally from Nintendo's Mario series and make a cameo appearance in the game together with other enemies from the Mario games. Goombas can be found in certain dungeons and in the 2-D passages found in the game.

They can be killed either with the sword or, similarly to the Mario games, by using Roc's Feather to stomp on their heads and flatten them. Killing them with the latter method always results in a heart being left behind from the Goomba.