The Hamiltonian is always given in an operator form, i.e. it is a (rigged)-Hilbert space operator written as a function (typically algebraic) of other operators, such as position, momentum, angular momentum (including spin), electric charge, parity, etc. Only the Hilbert space is mapped to a certain space (a function space) so that the Hamiltonian and all other observables could be represented by differential operators. The so-called algebraic methods work by assuming no "projection onto a function space" takes place. This works for any Hamiltonian with (a) discrete (part of a) spectrum. This is easiest to see for the harmonic oscillator, but it also works for the discrete spectrum of the H-atom Hamiltonian.
1st step: identify the exact form of the Darwin correction term. IIRC, this is expressible only in a Hilbert space of wave functions, i.e. the "projection onto a function space" ##|\psi\rangle \rightarrow \langle x|\psi\rangle ## already took place.
2nd step: project the abstract vector ##|2,1\rangle## onto the same basis as the Hamiltonian was projected.
3rd step: compute the matrix elements.