We propose a method based on deep reinforcement learning that efficiently prepares a quantum many-body pure state in thermal or prethermal equilibrium. The main physical intuition underlying the method is that the information on the equilibrium states can be efficiently encoded/extracted by focusing on only a few local observables, relying on the typicality of equilibrium states. Instead of resorting to the expensive preparation protocol that adopts global features such as the quantum state fidelity, we show that the equilibrium states can be efficiently prepared only by learning the expectation values of local observables. We demonstrate our method by preparing two illustrative examples: Gibbs ensembles in non-integrable systems and generalized Gibbs ensembles in integrable systems. Pure states prepared solely from local observables are numerically shown to successfully encode the macroscopic properties of the equilibrium states. Furthermore, we find that the preparation errors, with respect to the system size, decay exponentially for Gibbs ensembles and polynomially for generalized Gibbs ensembles, which are in agreement with the finite-size fluctuation within thermodynamic ensembles. Our method paves a path toward studying the thermodynamic and statistical properties of quantum many-body systems in quantum hardware.