I'd like to share how I do my elixir and gold farming and earn way more than I spend in training troops. I'm currently in town hall level 6. This might be applicable to other levels too but may be hard to pull off on higher TH levels due to more defense structures available for the enemy.
3. Target only enemy base that your troops can handle. There's no point attacking your troops to a base with lvl 3 3x mortars and 3x wizard tower (and more cannon and tower) and You'll only waste the elixir you've spent on training your troops.
1. Look for enemies with high gold and elixir - the most important thing to consider. I recommend that you target enemies with atleast 150k total converted resources (example 50k gold + 100k elixir or vice versa). It doesn't matter if you need gold more than elixir, the goal here is to get the most number of loot from your attack. (You can always compensate the other resources on your next attack anyway)
2. Look for enemies with gold mines and elixir collectors found outside the base - of course the resources are stored on the storage buildings BUT you also have to remember that until the player collects these resources, they stay on the mine or collector. One thing I noticed is that for example, I came across an enemy with let's say 200k of gold, most of the time I can get half of it from the mines alone.
If you have selected an enemy base
4. Plan carefully on how you are going to initiate your attack. You only have I guess 30 secs to decide if you are going to attack an enemy, you can also use this 30 secs to plan for your attack on top of the 2 mins and 30 seconds allotted for the actual attack
5. Lure the clan clastle troops first. Using an archer or barbarian. Attack a structure near the clan castle to lure out the troops. Drop units 1 by 1 until all troops of the enemy comes out. Kill them using a lightning spell or lure them out to an open area far from enemy defense and ambush them using archers or barbarian.
6. Divert mortars attack from the side where the mines and collectors are by dropping giants on another side. This is to prevent the mortar from laying waste a bunch of your small troops in a shot or two.
7. Drop some few giants on the side where the mines and collectors are located. This is to get the attention of the wizard towers, cannons and archer towers to your giants - and away from your "looters".
When I say looters, it could be goblins, archers or barbarians.
8. Drop wall breakers near the mortars. A better plan is to destroy the mortars if you can. This way, your giants can last longer as the the number of defenses attacking them also decreases. Time the wall breakers carefull. You don't want to waste thousands of elixir by dropping a wall breaker only to be killed by the splash damage of the mortars attacking your giants.
9. Once the defenses of the enemy is busy attacking your giants, start dropping your looters near the mines and collectors. Scatter them, in case bombs are planted, your looters won't be wiped out,
10. Don't drop all troops at once. Leave some giants and looters on hand. You save some in case traps caught your first batch.
This technique proves to be effective for me. I've been using this for quite some time now. Actually right before I wrote this blogpost, I only have 350k'ish golds and 150k'ish elixir. By the time I finish writing this article, I've earned ..... (Check the screenshot below). To give you an idea, it took me around 20-30 mins writing this because I'm using an iPad and is playing on the side.