There are two definitions of cohomologies I've found so far: The first (very good to understand) definition is via coboundaries and is very often written as
$$ H^p = {Z^p}/{B^p} ,$$
and the second one is
$$ H^p = Ext_g^p .$$
I have no clue why they are identical. If the answer is too long its enough to give a source to read it.
I use it in the context of Lie Algebras, so if there is an easier proof only for Lie Algebras, it's enough for me.
EDIT: i have both definitions and they look pretty similar when u use the right complexe(s). But i still cant figure out why the sequence
$ P_2 \overset{d_1}{\rightarrow} P_1 \overset{d_0}{\rightarrow} P_0 \overset{\epsilon}\rightarrow M $
is exact, the rest is clear now. Tomorrow i will write the exact definitions to this post (I dont have my work at home)