A module over a ring R is an abelian group M with a multiplication R \times M \to M such that (rs)m = r(sm), (r + s)m = rm + sm, r(m + n) = rm + rn and 1m = m [1,2]. Over a field, modules are vector spaces. Other examples are R itself, its ideals, R^n and the quotients R/I. A \mathbb{Z}-module is just an abelian group, with nm = m + \cdots + m.
A k[x]-module is a vector space V over k together with a linear map T \colon V \to V, the action of x; a polynomial p acts as p(T). Its submodules are the subspaces W with T(W) \subseteq W. In the figure, V = \mathbb{R}^2 and T(a, b) = (a + b, b), a shear.
For v = (a, b) with b \neq 0, the vectors v and Tv are independent, so the submodule generated by v is all of \mathbb{R}^2; the points v, Tv, T^2v, \ldots lie on a horizontal line at distance b from each other. On the x-axis we have Tv = v, and the x-axis is the only submodule other than 0 and \mathbb{R}^2.
A homomorphism \varphi \colon M \to N is an additive map with \varphi(rm) = r\varphi(m). Its kernel \ker \varphi and its image \operatorname{im} \varphi are submodules, and its cokernel is \operatorname{coker} \varphi = N/\operatorname{im} \varphi. So \varphi is injective when \ker \varphi = 0 and surjective when \operatorname{coker} \varphi = 0, and M/\ker \varphi \cong \operatorname{im} \varphi as for rings.
For example, multiplication by 2 on \mathbb{Z} has kernel 0 and cokernel \mathbb{Z}/2, while multiplication by 2 on \mathbb{Z}/2 is the zero map, with kernel and cokernel both \mathbb{Z}/2. These two maps come back in the snake lemma below.
A sequence of homomorphisms \cdots \to M_{i-1} \to M_i \to M_{i+1} \to \cdots is exact at M_i when the image of the incoming map equals the kernel of the outgoing one [1,2]. Thus 0 \to M \to N is exact when M \to N is injective, and M \to N \to 0 is exact when it is surjective.
A short exact sequence 0 \to A \to B \to C \to 0, with maps f and g, says that f is injective, g is surjective and \operatorname{im} f = \ker g. So B contains a copy of A, and B/f(A) \cong C. For example, 0 \to \mathbb{Z} \to \mathbb{Z} \to \mathbb{Z}/2 \to 0, with multiplication by 2 followed by reduction, is short exact.
The sequence splits if there is a homomorphism s \colon C \to B with g \circ s = \mathrm{id}; then B \cong A \oplus C. Over a field every short exact sequence splits, since a complement of f(A) can be chosen. In the figure, f(t) = (t, t/2) and g(x, y) = y - x/2, the lines g = c are the cosets of f(\mathbb{R}), and any line L through 0 not parallel to them meets each coset once, which defines s.
Over \mathbb{Z} a short exact sequence need not split. A splitting of 0 \to \mathbb{Z} \to \mathbb{Z} \to \mathbb{Z}/2 \to 0 would send 1 to an element of order 2 in \mathbb{Z}, and there is none. Likewise 0 \to \mathbb{Z}/2 \to \mathbb{Z}/4 \to \mathbb{Z}/2 \to 0 does not split, because \mathbb{Z}/4 has an element of order 4 and \mathbb{Z}/2 \oplus \mathbb{Z}/2 does not.
Take two exact rows A_1 \to B_1 \to C_1 \to 0 and 0 \to A_2 \to B_2 \to C_2, with maps f_1, g_1 and f_2, g_2, and maps \alpha, \beta, \gamma from the first row to the second such that the two squares commute. The snake lemma says that there is an exact sequence \ker \alpha \to \ker \beta \to \ker \gamma \to \operatorname{coker} \alpha \to \operatorname{coker} \beta \to \operatorname{coker} \gamma [1].
The maps between the kernels and between the cokernels come from the rows. The middle map \delta is built by a path through the diagram. For z \in \ker \gamma, choose y \in B_1 with g_1(y) = z. Then g_2(\beta(y)) = \gamma(z) = 0, so \beta(y) = f_2(x) for a unique x \in A_2, and \delta(z) is the class of x in \operatorname{coker} \alpha.
Another choice of y differs by some f_1(a), which changes \beta(y) by \beta(f_1(a)) = f_2(\alpha(a)) and so changes x by \alpha(a), which is 0 in \operatorname{coker} \alpha. So \delta is well defined, and it is a homomorphism. Exactness at each place is checked by a similar walk through the diagram.
In the figure, both rows are 0 \to \mathbb{Z} \to \mathbb{Z} \to \mathbb{Z}/2 \to 0 and \alpha, \beta, \gamma are multiplication by 2. Then \ker \alpha = \ker \beta = 0 and \ker \gamma = \mathbb{Z}/2, and all three cokernels are \mathbb{Z}/2. For z = 1 we may take y = 1, so \beta(y) = 2 = f_2(1), and \delta(1) is the class of 1: the map \delta is an isomorphism.
Exactness then forces the map \operatorname{coker} \alpha \to \operatorname{coker} \beta to be 0, and indeed it is induced by multiplication by 2. If the rows are short exact, the sequence also starts with 0 \to \ker \alpha and ends with \operatorname{coker} \gamma \to 0. Applied to complexes, the snake lemma produces the long exact sequences of homology.