  Hamiltonian truncation is a non-perturbative numerical method for calculating
observables of a quantum field theory. The starting point for this method is to
truncate the interacting Hamiltonian to a finite-dimensional space of states
spanned by the eigenvectors of the free Hamiltonian $H_0$ with eigenvalues
below some energy cutoff $E_\text{max}$. In this work, we show how to treat
Hamiltonian truncation systematically using effective field theory methodology.
We define the finite-dimensional effective Hamiltonian by integrating out the
states above $E_\text{max}$. The effective Hamiltonian can be computed by
matching a transition amplitude to the full theory, and gives corrections order
by order as an expansion in powers of $1/E_\text{max}$. The effective
Hamiltonian is non-local, with the non-locality controlled in an expansion in
powers of $H_0/E_\text{max}$. The effective Hamiltonian is also non-Hermitian,
and we discuss whether this is a necessary feature or an artifact of our
definition. We apply our formalism to 2D $\lambda \phi^4$ theory, and compute
the the leading $1/E_\text{max}^2$ corrections to the effective Hamiltonian. We
show that these corrections non-trivially satisfy the crucial property of
separation of scales. Numerical diagonalization of the effective Hamiltonian
gives residual errors of order $1/E_\text{max}^3$, as expected by our power
counting. We also present the power counting for 3D $\lambda \phi^4$ theory and
perform calculations that demonstrate the separation of scales in this theory.
