It has become standard practice to describe systems that remain far from equilibrium even in their steady state by Langevin equationswith colored noise which is chosen independently from the friction contribution. Since these Langevin equationsare typically not derived from first-principle Hamiltonian dynamics, it is not clear whether they correspond to physically realizable scenarios. By exact Mori projection in phase space we derive the nonequilibrium generalized Langevin equation(GLE) for an arbitrary phase-space dependent observable A from a generic many-body Hamiltonian with a time-dependent external force h(t) acting on the same observable A. This is the same Hamiltonian from which the standard fluctuation-dissipation theorem is derived, which reflects the generality of our approach. The observable A could, for example, be the position of an atom, of a molecule or of a macroscopic object, the distance between two such entities or a more complex phase-space function such as the reaction coordinate of a chemical reaction or of the folding of a protein. The Hamiltonian could, for example, describe a fluid, a solid, a viscoelastic medium, or even a turbulent inhomogeneous environment. The GLE, which is a closed-form equationof motion for the observable A, is obtained in explicit form to all orders in h(t) and without restrictions on the type of many-body Hamiltonian or the observable A. If the dynamics of the observable A corresponds to a Gaussian process, the resultant GLE has a similar form as the equilibrium Mori GLE, and in particular the friction memory kernel is given by the two-point autocorrelation function of the sum of the complementary and the external force h(t). This is a nontrivial and useful result, as many observables that characterize nonequilibrium systems display Gaussian statistics. For non-Gaussian nonequilibrium observables correction terms appear in the GLE and in the relation between the force autocorrelation and the friction memory kernel, which are explicitly given in terms of cubic correlation functions of A. Interpreting the external force h(t) as a stochastic process, we derive nonequilibrium corrections to the fluctuation-dissipation theorem and present methods to extract all GLE parameters from experimental or simulation time-series data, thus making our nonequilibrium GLE a practical tool to study and model general nonequilibrium systems.