Arrows in physics typically signify a vector of some sort. And means something that has both direction and magnitude.
1. For the magnetic field the tiny arrows show the direction of the magnetic field, typically signified as the B field (E field for the electric half of EM field).
Those arrows have no real meaning until they are examined in relation to an electrical charge, q. When a charge, q, is passed through the B field (or the B field is passed over it) a force F is produced while there is motion v. And the direction of that force is found from F = q(v X B) for a point charge q moving with velocity v through the B field.
v X B = vB sin(theta) is a cross product. And the direction of that cross product follows the right hand rule (i.e., with the right hand curl you fingers in the direction v to B and the thumb will point to the direction of the cross product result). In the special case when the charge passes through B at a right angle theta = 90, we have F = qvB for the force produced.
Bottom line those B arrows show the direction of the field and that can be used to determine to find the direction of a force created on a charge moving through that field.
2. 1. was a bit long, but now I can shorten this answer. Note F = qvB. If we change the direction of the current here, we make the v become -v, a 180 deg change in the direction of the velocity. And there we are with the change in current direction (which is the motion of electrons, lots of q's with velocities v) we change the direction of the force result F to minus F, -F. In a practical experiment, if your EM magnet has a north pole on one end it when passing a current through its coil, the north pole will switch to the opposite end if you reverse the current through the coil around the magnet.