Two observables are compatible when they can be described by a common eigenbasis. A system prepared in one of those basis states has a definite value for both quantities. In a finite-dimensional system, compatibility means the operators commute. Applying them in either order gives the same result.
For example, in the standard central-potential model of hydrogen, energy and the z component of orbital angular momentum commute. A state labelled by the quantum numbers n, , and m has a definite energy and a definite z component .
The spin of a single electron illustrates the other possibility. Definite spin along z gives equal probabilities for the two spin outcomes along x. Compatibility is a property of the operators. Certainty for a particular pair of outcomes depends on the prepared state.
What if a state mixes several common eigenstates? A joint measurement can still assign a pair of outcomes, but the pair can vary from trial to trial. A common basis makes joint prediction possible. The preparation determines whether that prediction is certain.