Elixir is vital in the training of troops and is also required to be able to build many of the structures in the game. You will need it to upgrade your Barracks, for example, as well as army camps. It is indicated in Clash of Clans by a purple droplet icon. To get it, you have to 'pump' it from the Ley Line through the ground using a resource extractor.
Once an Elixir Collector is ready to collect, you will see a big Elixir symbol above it. Tap it to add the Elixir to your storage, if there is space. When your Elixir is at maximum capacity (you can see what this is by looking at the Elixir bar in the top right corner of the screen) you should consider building more Elixir Storage, where possible.
Elixir is used to upgrade Gold Mines, Gold Storage, Army Camps, Spell Factories, Barracks and Laboratories.
To get Elixir, you need to use Elixir Collectors.
Upgrade your Elixir Collectors to get the most out of your surroundings.
Dark Elixir was added to Clash of Clans as part of an update. The way to earn Dark Elixir is mainly through stealing it, as well as by using the Dark Elixir drill. You can purchase this drill at Level 8. It's the least important of all the resources so don't worry too much about it when you're starting out.
To get Dark Elixir, you need a Dark Elixir Drill.