An underlying mechanism of the high temperature superconductivity (HTS) and the nature of the adjacent phases remains the biggest mystery of condensed matter physics. It is believed that the key to understanding of HTS lies in revealing the origin of the enigmatic properties of the pseudogap state that settles in the underdoped region between the superconducting transition temperature Tc and the pseudogap temperature T* > Tc. The experiments indicate that the pseudogap state is a distinct thermodynamic phase that exhibits metallic transport, magnetoelectric effect and the nematicity. We develop a unified theory that offers a quantitative description of the pseudogap phase properties and describes the observed phase diagram. The proposed mechanism of the superconductivity is the emergence of the condensate of dyons, the composite particles carrying both electric and magnetic charge, in our case the Cooper pair bound with the magnetic monopole. In the HTS phase, the dyon condensate coexists with the fundamental Cooper pair condensate and the elevated Tc results from the stabilizing effect of the monopole condensate. We show that in the pseudogap phase charged magnetic monopole condensate realizes the oblique confinement of Cooper pairs. The universality of the HTS phase diagram for different materials reflects the unique topological mechanism responsible for formation of the emerging phases. Our findings provide a topological reason for the high critical temperature in HTS.