We consider a system of two spins that are coupled via an isotropic Heisenberg Hamiltonian. For the first time, a two-step method for the preparation of an arbitrary quantum state of two qubits in the form of the Schmidt decomposition is proposed. The simplified version of this method is applied to the physical system of an atom having with a nuclear spin 1/2 and one valence electron. As an example, the preparation of two-spin quantum states in the 31 P system is considered.