Imaging is central to gaining microscopic insight into physical systems, and new microscopy methods have always led to the discovery of new phenomena and a deeper understanding of them. Ultracold atoms in optical lattices provide a quantum simulation platform, featuring a variety of advanced detection tools including direct optical imaging while pinning the atoms in the lattice1,2. However, this approach suffers from the diffraction limit, high optical density and small depth of focus, limiting it to two-dimensional (2D) systems. Here we introduce an imaging approach where matter wave optics magnifies the density distribution before optical imaging, allowing 2D sub-lattice-spacing resolution in three-dimensional (3D) systems. By combining the site-resolved imaging with magnetic resonance techniques for local addressing of individual lattice sites, we demonstrate full accessibility to 2D local information and manipulation in 3D systems. We employ the high-resolution images for precision thermodynamics of Bose–Einstein condensates in optical lattices as well as studies of thermalization dynamics driven by thermal hopping. The sub-lattice resolution is demonstrated via quench dynamics within the lattice sites. The method opens the path for spatially resolved studies of new quantum many-body regimes, including exotic lattice geometries or sub-wavelength lattices3–6, and paves the way for single-atom-resolved imaging of atomic species, where efficient laser cooling or deep optical traps are not available, but which substantially enrich the toolbox of quantum simulation of many-body systems.