The image you've linked shows us how to find the magnetic field associated with a long current-carrying wire. But we're interested not in the field that the wire creates, but rather the field that the wire experiences. The fields that a charged particle generates don't influence itself (see, perhaps, this question). And so all we need to worry about is: what is the nature of the external field (that generated by the permanent magnet indicated by the N and S, shown as dotted lines), and what direction is the current travelling in? The fundamental law that governs the way magnetic fields exert forces on currents is:
$$ \vec{F} = \vec{I} \times \vec{B} $$
If you haven't met the vector cross product yet, don't worry. This equation says two things. Firstly, it says that the magnitude of the force acting on the charged particles moving through the wire is
$$ F = IB \sin \theta $$
where $\theta$ is the angle between the direction of the current and the direction of the magnetic field. You can hopefully see from the diagram that $\theta = 90$ degrees. Secondly, it says that the direction of the force is perpendicular to both the direction of the current and that of the magnetic field.
This does leave some ambiguity as to whether the force points upwards or downwards, but the choice is just a matter of convention. One day, somewhere, somebody decided that the vector cross product should be 'right handed'. Hence there are various 'right hand rules' that help you get the direction right. The one I use is this: put your right hand out flat with your thumb outstretched. Align your four fingers with the first vector in the cross product (in this case, the current $\vec{I}$). Then rotate your hand such that your palm faces forwards, through the smallest angle possible, so that your four fingers are aligned with the second vector. You'll find that you may need to turn your hand upside down to do this. The direction of your thumb is the direction of the resulting vector. I admit, this may sound confusing, but it's difficult to convey something like this in words, and in fact the rule is fairly simple.