We present a novel protocol for high-fidelity qubit state preparation and measurement (SPAM) that combines standard SPAM methods with a series of in-sequence measurements to detect and remove errors. The protocol can be applied in any quantum system with a long-lived (metastable) level and a means to detect population outside of this level without coupling to it. We demonstrate the use of the protocol for three different qubit encodings in a single trapped 137Ba+ ion. For all three, we achieve the lowest reported SPAM infidelities of 7(4)×10−6 (optical qubit), 5(4)×10−6 (metastable-level qubit), and 8(4)×10−6 (ground-level qubit).