Electromagnetism is the study of the electromagnetic force which is a type of physical interaction that occurs between electrically charged particles. The electromagnetic force usually shows electromagnetic fields, such as electric fields, magnetic fields, and light. The electromagnetic force is one of the four fundamental interactions in nature. The other three fundamental interactions are the strong interaction, the weak interaction, and gravitation.
Hans Christian Oersted was a professor of science at Copenhagen University. In 1820 he arranged in his home a science demonstration to friends and students. He planned to demonstrate the heating of a wire by an electric current, and also to carry out demonstrations of magnetism, for which he provided a compass needle mounted on a wooden stand.
While performing his electric demonstration, Hans Christian Oersted noted to his surprise that every time the electric current was switched on, the compass needle moved. He kept quiet and finished the demonstrations, but in the months that followed worked hard trying to make sense out of the new phenomenon.
However, Hans Christian Oersted could not explain why. The needle was neither attracted to the wire nor repelled from it.
Instead, it tended to stand at right angles. In the end he published his findings without any explanation.