In Clash of Clans, if you are a smart player, your farming strategy should vary drastically as your Town Hall increases in level because you can only efficiently loot players who are one Town Hall level lower than you. There is no wrong ways to play mobile strategy games, but some better ways. Here, you can read the farming guide for Town Hall Levels 2&3 below.
You end up at Town Hall level 2 by the end of the tutorial. You can actually farm some at Town Hall 2 before upgrading – it is very easy. All you have to do is make 20-30 Barbarians (be sure to upgrade your Army Camp to hold 30 units as soon as you can) and then start matchmaking. Look for people with exposed resources and just drop your Barbarians right on top of the resources. You can easily loot to cap within a raid or two. Do not worry about losing your shield – most players will not attack you anyway as there is no point since you have so little loot to take.
Once you hit Town Hall 3, you can finally begin to farm off of other players. The recommended Trophy range is 600 or less. At this level, you can get two level 3 Army Camps, giving you a max supply count of 70. Your best bet is to just make 70 Barbarians and attack every time. Note that 70 Barbarians at 25 Elixir each will run 1750 Elixir. As long as you steal at least this much Elixir, you will be able to sustainably farm.
As a level 3 Town Hall player, you will have to fight against players with a single Mortar. You will want to spread out your Barbarians in order to avoid taking too much damage from it. Getting up to level 2 Barbarians will help you tank a Mortar much easier. You can do the same thing with Goblins as well – the downside is Goblins take more time to train. They are more effective at taking loot though!