Advances in high-resolution and spin-resolved scanning tunnelling microscopy, as well as atomic-scale manipulation, have enabled the bottom-up, atom-by-atom creation and characterization of quantum states of matter. This capability is largely based on controlling the particle-like or wave-like nature of electrons and the interactions between spins, electrons and orbitals, as well as their interplay with structure and dimensionality. In this Review, we describe recent progress in using a scanning tunnelling microscope to create artificial electronic and spin lattices that lead to various exotic quantum phases of matter, ranging from topological Dirac dispersion to complex magnetic order. We also offer our perspective on the future directions of this developing field, namely the exploration of non-equilibrium dynamics, engineering quantum phase transitions and topology, prototype technologies and the general concept in nature of evolution of complexity from simplicity. In this Review, we discuss how quantum states of matter, such as Dirac materials and complex magnetic order, can be created bottom-up by patterning individual atoms on surfaces and subsequently characterized with scanning tunnelling microscopy and spectroscopy.