It is, of course, very hard to know which units to take when you don't know the layout of the enemy base. If you are attempting a campaign level that you have tried before, of course you are then able to adapt your unit selection. Usually, general purpose troops include a good mix of units to focus on defenses, ranged units, resource gathering and melee combat. You can't take one of every unit, however, as some are important to take in large groups, like Barbarians, and others take up a significant amount of housing space, or space on the 'bus' (or whatever method of transport the troops use to get to the enemy base).
See the Units section of this guide for more info on each unit type and their strengths and weaknesses. Below are a few examples of popular army compositions for general purpose attacks, and raiding:
Unit Composition Strategies
General Purpose Attacks
To combat Walls and enemy defenses, you really need to take a mix of Wall Breakers and Giants. Generally, two or three Wall Breakers should be sufficient, as you will rarely need to make more than a couple of holes in the enemy walls. Giants are great in larger groups, but the amount you can take will depend a lot on what your troop capacity is. The more the better, generally, as they will target enemy defensive weaponry and are superb at taking them down. Try to deploy them in a few distinct groups so that you are not left with one or two structures at the end picking your guys off.
Archers deal good damage but need protecting from enemy defenses
Attacking Everything Else:
With the defenses taken care of, Barbarians and Archers are most people's top picks. If you are not going specifically to raid resources, Goblins tend to be a bit weak for the price. While Archers are also weak, if you deploy them once the Giants are occupying enemy defenses, they should be safe and offer a great attacking threat. Barbarians are strong and superb in large numbers. Use them to deal the damage to enemy structures. It says a lot that two of the best units in the game are pretty much provided to you at the start - don't feel you have to use the newer units once you unlock them.
Alternative General Purpose Troops:
If you don't have much Elixir to spend, skip everything above except the Wall Breakers and Archers - a few Wall Breakers and the rest Archers, positioned sensibly, allow for good damage in an enemy base without the expense of Giants and the like.
For a more balanced selection of troops, go for a mix of Barbarians and Archers, taking up roughly two-thirds of your unit allowance. A large group of Giants, a few Wall-Breakers and some Wizards to fill out the rest, will allow for an effective attack. You can also take a Balloon which is a very good unit to employ right at the end, once all defenses are down - and when you will often be running low on troops. Unless the enemy have Archers or Air Defenses, it will be able to fly around unharmed and mop up anything remaining.
For raiding attack strategies - that is to say those where you are trying primarily to get Elixir or Gold rather than caring about how many stars you achieve - Wall Breakers, once unlocked, are important to be able to get at any protected Storage buildings and clear a path if necessary. You should also take Archers, who, in large groups, deal large amounts of damage and can also effect anything over the top of walls. Finally, for once there is gap cleaved into the enemy base with the previous two unit types, you should take lots and lots of Goblins. These guys are designed to specifically target enemy resource structures, dealing more damage to them and speeding across the map to get there.
Don't forget that you are able to purchase Spells which are regularly used by players to turn the tide of battle. Something like a Healing Spell can be vital to turning your fortunes around. You can see a list of the Spells available below, from the Spell Factory (unlocked once your Town Hall is upgraded to Level 5).
Santa's Surprise (limited time only)
There are really two key areas to attacking in Clash of Clans. The first is which troops you decide to send on the assault. You are limited by how many you can take depending on the level of your Army Camps. You can see some information on Army Camp levels and the amount of troops these allow in the Army Camps section of this guide.