Two-by-two block matrices arise in various applications, such as in domain decomposition methods or, more generally, when solving boundary value problems discretized by finite elements from the separation of the node set of the mesh into 'fine' and 'coarse' nodes. Matrices with such a structure, in saddle point form arise also in mixed variable finite element methods and in constrained optimization problems.A general algebraic approach to construct, analyse and control the accuracy of preconditioners for matrices in two-by-two block form is presented. This includes both symmetric and nonsymmetric matrices, as well as indefinite matrices. The action of the preconditioners can involve element-by-element approximations and/or geometric or algebraic multigrid/multilevel methods.