Control over quantum dynamics of open systems is one of the central challenges in quantum science and engineering. Coherent optical techniques, such as coherent population trapping involving dark resonances1,2, are widely used to control quantum states of isolated atoms and ions. In conjunction with spontaneous emission, they allow for laser cooling of atomic motion3, preparation and manipulation of atomic states4, and rapid quantum optical measurements that are essential for applications in metrology5–7. Here we show that these techniques can be applied to monitor and control individual atom-like impurities, and their local environment8–11, in the solid state. Using all-optical manipulation of the electronic spin of an individual nitrogen–vacancy colour centre in diamond, we demonstrate optical cooling, real-time measurement and conditional preparation of its nuclear spin environment by post-selection. These methods offer potential applications ranging from all-optical nanomagnetometry to quantum feedback control of solid-state qubits, and may lead to new approaches for quantum information storage and processing.