Can you kill Iron Golems?

Solution 1:

They have a lot of hitpoints, it'll take more than a few swings to hit them, but they do go down eventually.

A better method to kill them would be to suffocate them using Sand or Gravel. They cannot drown and take no damage from falling, meaning any trap will have to use Suffocation to kill them.

When killed, they drop Iron Ingots and Poppies.

Check out this tutorial on how to build effective Iron Golem Farms. Further, you can read more about Iron Golems in general on the Minecraft Wiki

Solution 2:

Yes, it has 100 health points though. Try to get it aggroed by night time mobs so that they will attack it for you.

If you kill it, it will drop iron ignots and poppy. Read more about them Iron Golem Minecraft Wiki