Bodies are made up of atoms, most of which are hydrogen atoms, and they normally spin randomly. When placed within a strong magnetic field, these atoms spin in the same direction as the magnetic field. When the radio frequency is introduced, it transmits through the body's tissues, causing the hydrogen atoms to create a signal. The signals produced help to create an image.
Learn more about the general preparations and what to expect when you are having an MRI scan https://youtu.be/e3UQcNYxrIg