Fault-tolerant quantum computing requires initializing the quantum register in a well-defined fiducial state. In solid-state systems, this is typically achieved through thermalization to a cold reservoir, such that the initialization fidelity is fundamentally limited by temperature. Here we present a method of preparing a fiducial quantum state that beats the thermal limit. It is based on real-time monitoring of the qubit through a negative-result measurement -the equivalent of a 'Maxwell's demon' that only triggers the experiment upon the appearance of a very cold qubit. We experimentally apply it to initialize an electron spin qubit in silicon, achieving a ground-state initialization fidelity of 98.9(4)%, a ≈ 19% improvement over the intrinsic fidelity of the system. A fidelity approaching 99.9% could be achieved with realistic improvements in the bandwidth of the amplifier chain or by slowing down the rate of electron tunneling from the reservoir. We use a nuclear spin ancilla, measured in quantum nondemolition mode, to prove the value of the electron initialization fidelity far beyond the intrinsic fidelity of the electron readout. However, the method itself does not require an ancilla for its execution, saving the need for additional resources. The quantitative analysis of the initialization fidelity reveals that a simple picture of spin-dependent electron tunneling does not correctly describe the data. Our digital 'Maxwell's demon' can be applied to a wide range of quantum systems, with minimal demands on control and detection hardware.