As king of the city, it is your duty to keep your people safe. Many enemies will try to break your defenses and some will probably eventually succeed!
Don't panic though! Getting your city plundered is not uncommon in God Kings. Rebuild your empire and claim the position you deserve, train a much bigger army and no one will dare to confront you.
How to achieve that
To resist enemy attacks you will need to train a considerable army. Fortifications will also force attackers to use up some of their march space with Siege Units if they wish to break through your defenses. If they fail to do so, only your fortifications will suffer.
To empower your troops, even more, make sure to complete the Divine Powers designed for troop improvements in the War Temple as soon as possible, along with the other combat boosts.
Unlock higher tiers of troops, since their stats are much higher and will allow you to grow in power quicker.
Keep your resources safe
In case of defeat, the resources of the city would be exposed. Research the related powers in the Protection Temple to protect some of your resources. These protected resources will be crucial for rebuilding the city, healing your troops and claiming revenge!
Keep the shield up
If you want certainty, you can keep your shield up at all times. This however costs energy and prevents you from attacking other players (attacking beasts on the map, as well as taking part in rallies against apostates is still possible).