We report the step-by-step construction of the exact, closed and explicit expression for the evolution operator U(t) of a localized and isolated qubit in an arbitrary time-dependent field, which for concreteness we assume to be a magnetic field. Our approach is based on the existence of two independent dynamical invariants that enter the expression of SU(2) by means of two strictly related time-dependent, real or complex, parameters. The usefulness of our approach is demonstrated by exactly solving the quantum dynamics of a qubit subject to a controllable time-dependent field that can be realized in the laboratory. We further discuss possible applications to any SU(2) model, as well as the applicability of our method to realistic physical scenarios with different symmetry properties.