A magnetic field is a fundamental force field that exists around magnetic materials and moving electric charges. It's an invisible influence that can attract or repel other magnetic objects and exert forces on moving charged particles. We can visualize magnetic fields using field lines that show the direction and strength of the magnetic force.
Magnetic fields are created by moving electric charges, such as current flowing through a wire. When current flows through a conductor, it creates circular magnetic field lines around the wire. The direction of these field lines follows the right-hand rule. Magnetic fields can exert forces on other moving charges through the Lorentz force, which depends on the charge, velocity, and magnetic field strength.
Magnetic fields have countless applications in modern technology. Electric motors use magnetic fields to convert electrical energy into mechanical motion. MRI machines use powerful magnetic fields to create detailed images of the human body. Computer hard drives store data using magnetic fields, and particle accelerators use magnetic fields to guide charged particles at extremely high speeds. Even simple compasses rely on Earth's magnetic field for navigation.