David didn't go into battle with goliath without any armor on. David had put on the full Armor of God, long before Paul wrote about it. David's battle with Goliath is a good example of how the armor works in real life.
Belt of Truth
David knew that there was a giant making fun of God and everyone else was afraid to fight him.
Breastplate of Righteousness
Later in life David was known a s the man after God's own heart. He lived a life showing the heart of God to others.
Shoes of Peace
How can going to fight a giant be peace? David had peace because he knew God will fight for him. Jesus has already fought the battles for us.
Shield of Faith
David didn't put his faith in King Saul's armor made by man, instead he put in God.
Helmet of Salvation
David knew who he was in God. He knew God would protect him as he had in the past.
Sword of the Spirit
I'm not talking about the 5 smooth stones that David had for his sling. David knew what God had said and that He would keep His word.
With all that in place, David defeated Goliath with one stone. All the trash talk that Goliath had done was nothing when the stone met his forehead. Likewise with us,satan will try all kinds of trash talk and mind games to get us to become ineffective against him. That is why it is important that we have the Armor of God on to protect is from the father of lies.