In this talk, I shall cover general topics concerning the present knowledge of magnetic fields in galaxies, clusters of galaxies and high redshift objects. Some outcomes of the measurements of the fields in galaxies and clusters of galaxies will be presented. I shall discuss what conformal invariance of electromagnetic fields is and how by breaking it, magnetic fields can be created in the early universe. This will be illustrated by describing some well known mechanisms proposed in the literature, as well as their limits of validity.