Magnetic field lines are closed because there are no magnetic “charges” (usually called magnetic monopoles) analogous to electrical charges like protons and electrons. When electric field lines end, they always end on an electric charge.
The apparent absence of magnetic charges makes for an unattractive asymmetry in Maxwell’s equations. Some physicists think that magnetic charges can exist but are now extremely rare. They may have been common in the very early universe, before cosmic inflation occurred.
Electromagnetic field lines help you visualize the direction and magnitude of the forces that the field exerts on charges. For an electric field, each field line points in the direction of the force it exerts on a positive charge. Where the field lines are closer together, the force is stronger, and where they are farther apart the force is weaker.
For a magnetic field, it’s more complicated, because only a moving charge feels a magnetic force. The magnetic force is perpendicular to both the magnetic field line and the charge’s velocity. Again, field lines that are closer together indicate a stronger force.
I prefer to visualize electric and magnetic fields as two little vectors at each point in space. You can get the field lines just by “connecting the arrows” from point to point.