If you have seen in the treasure shop of Clash of Clans those colored shields that appear in exchange for gems, or a shield that appears at the top of the game screen next to your name and level, but you don't know what it means, so you have to read this...
Usefulness of shields in Clash of Clans
Shields are items that, when activated, protect you from common multiplayer attacks and disproportionate farming. It is a way for the game to balance farming and help protect those with fewer resources.
There are free shields for a few hours and shields that protect you for several days but you must buy them with gems.
You have to know that, when using a shield, or in case one is automatically activated after a battle, you cannot attack until the protection runs out, otherwise you will lose it.