A Danish scientist Hans Christian Oersted discovered the magnetic effect of current in a simple experiment when he performed a simple experiment establishing the relationship between electricity and magnetism.
In the experiment, he took a conducting wire and placed a magnetic needle just below the wire. When he passed a large amount of current through the wire he found that the needle deflects from its normal position and points perpendicular to the direction of current applied and when the current is passed through the opposite direction then the needle deflects in the opposite direction.
These observations led to the interpretation that there must be some magnetic effect of the current due to which the magnetic needle deflected perpendicular to the direction of flow of current. Thus, he proved that electric current produces magnetic field around the current carrying conductor.