The larger and better trained a force is will usually win the day. For example, level 5 wizards coming out of a clan castle will put an immediate dent in the enemy force. That being said, important upgrades that will assist both on offense and defense are your camps and the clan castle. The higher level these are at, the more troops you can take into battle and the more defenders you can have on hand to repel an attack. Your camp should be upgraded to its highest level until you would have to upgrade your Town Hall in order to upgrade further. ALL clan members should have a minimum level 3 Clan Castle so the dragon can be employed on defense. It will also allow you to carry additional assault troops such as archers and wizards to fall in behind giants to help destroy defenses.
Next are troop levels. This again goes without saying but is an important part of whether you win or lose and how many stars you will claim as a result. You want to max the big three first - barbarians, archers and giants followed by wizards. This is a necessary evil and is both expensive and time consuming so pick your upgrades wisely. There are a lot of different ways to attack and win but this is just the basics. A solid foundation will allow you to build a force that can take down most opponents you will face, provided you deploy them wisely.