When you first start out playing Clash of Clans, you don't have much stuff. What are the first things to do when starting that will benefit you in the long run? Are defenses or loot the priority?
You get a three day shield when you start playing. Keep in mind that the shield will go away if you attack other players, so refrain from doing so if you want to keep your shield (attacking the goblins will not break your shield).
I recommend to build your resource buildings for the first 2 days because you are protected by the shield. On the last day that you have your shield, build your defences in preparation for the shield to drop.
Make sure you don't spend too many gems at the start because if you do not want to spend money, keeping your extra gems can help you to buy a third builders hut in the future.
When you start the game the tutorial will guide you 'till you reach Town Hall level 2. What I recommend most is that after the Town Hall level 2 you go straight away to the level 3, after collecting some loot. Then start upgrade your everything, like defenses, walls, etc., etc., to max. And by max I mean upgrade everything except the Town Hall to the level where you can upgrade no more. For more details see this blog post about the basics of starting a game.