Empires and Allies is a PvP game, so other players can attack your empire and cause your buildings to become ruined permanently. To make your empire immune and prevent other players from attacking you, you need to activate your World Embassy. Your World Embassy is granted to you at level 6 and can make your empire immune for 24 hours.
You can extend the length of your World Embassy protection by hiring your friends to help. You can either click on "Hire a Friend" to select one, or you can pay 3 Empire Points to fill an Embassy Slot an extend your protection. As long as you do not invade any other empires, your Embassy will protect your empire. Hopefully this has taught you how to make your empire immune to attacks in Empires and Allies.