In the present paper, the notions of compatible and almost compatible Riemannian and pseudo-Riemannian metrics are introduced. These notions are motivated by the theory of compatible Poisson structures of hydrodynamic type (local and nonlocal) and generalize the notion of flat pencils of metrics, which plays an important role in the theory of integrable systems of hydrodynamic type and Dubrovin's theory of Frobenius manifolds. Compatible metrics generate compatible Poisson structures of hydrodynamic type (these structures are local for flat metrics and nonlocal if the metrics are not flat). For the “nonsingular” case in which the eigenvalues of a pair of metrics are distinct, we obtain a complete explicit description of compatible and almost compatible metrics.