You can defeat Ghirahim by using your sword and shield to block his attacks and then countering with a strike of your own. Alternatively, you can use the Goddess Sword to reflect his attacks back at him. You can also use the bombs to stun him.