Controlling ultracold atoms with laser light has greatly advanced quantum science. The wavelength of light sets a typical length scale for most experiments to the order of 500 nanometers (nm) or greater. In this work, we implemented a super-resolution technique that localizes and arranges atoms on a sub-50-nm scale, without any fundamental limit in resolution. We demonstrate this technique by creating a bilayer of dysprosium atoms and observing dipolar interactions between two physically separated layers through interlayer sympathetic cooling and coupled collective excitations. At 50-nm distance, dipolar interactions are 1000 times stronger than at 500 nm. For two atoms in optical tweezers, this should enable purely magnetic dipolar gates with kilohertz speed.