well, both of them are energy storage elements. the capacitor stores the energy in the form of an electric field and the inductor stores it in the form of an inductive field.
a capacitor opposes the change in the voltage across it. and an inductor opposes a change in the current through it. a good place to start how capacitors and inductors work is the power supply filter. a single capacitor is normally connected across the output of a bridge rectifier. the bridge rectifier give a full wave rectified DC output. the capacitor smoothes the ripples in the DC output by its property that i told you before "a capacitor opposes a change in the voltage across it"
then move on to filters and then oscillators, study transient analysis and steady state AC analysis. then you would get an idea about how capacitors and inductors work.
if you havent done it yet then its a good time to buy the book "The Art of Electronics". a really good explanation about inductors and capacitors from that book is that they are basically frequency dependent resistances. nice isnt it???