The generation of primordial magnetic fields and its interaction with the primordial plasma during cosmological phase transitions is turbulent in nature. I will describe and discuss results of direct numerical simulations of magnetohydrodynamic (MHD) turbulence in the early universe and the resulting stochastic gravitational wave background (SGWB). In addition to the SGWB, the primordial magnetic field will evolve up to our present time and its relics can explain indirect observations of weak magnetic fields coherent on very large scales. I will apply the numerical results to magnetic fields produced at the electroweak and the QCD phase transitions and show that these signals may be detectable by the planned space-based Laser Interferometer Space Antenna (LISA) and by Pulsar Timing Array (PTA). The detection of these signals would lead to the understanding of the underlying physics of cosmological phase transitions, which can have consequences on the baryon asymmetry problem and on the origin seed of observed magnetic fields coherent over very large scales at the present time.