Question: We started learning about electromagnetism in physics class, and the Right Hand Rule comes in handy as seems easy to use, but I'm curious as to how it actually works. I guess it's more of a math question since I think it just involves solving the cross product of the velocity of the charge and the magnetic field. I don't know anything about cross products, but I searched some things up and it seems that the matrix is has unit vectors in it which determine the directions, so would one have to solve the whole thing to determine the direction of the force on the charge? I know it has to be perpendicular to both of the vectors but that still leaves 2 directions.

Answer: 
The formula for the force of a particle due to its magnetic field is $F = q \vec v \times \vec B$. The cross product has the property that its result is always perpendicular to both arguments.

Its direction is simply a result of how the cross product function is defined and the sign of electric charge (an electron is defined as negative).

It is important to note that the order of the arguments matters as the cross product function is not commutative; generally $ \vec A \times \vec B \neq \vec B \times \vec A$. For vectors the direction will be reversed; for matrices both sides can be wildly different.
Look at the diagram below,

![enter image description here](https://i.stack.imgur.com/izVJ4.jpg)

Two vectors $B$ ***(Magnetic field vector )*** and $v$ ***( velocity vector of a proton )*** shown in the diagram are perpendicular to each other. Here, I have considered the simplest case where the two vectors are perpendicular to each other. The cross product of $B$ and $v$ gives us another vector $F$ ***( Force vector )*** which points in a direction perpendicular to both $B$ and $v$. This is the geometric meaning of the cross product. Say, $B$ and $v$ lie on the $x$-$y$ $plane$. The force vector obtained as a result of the cross product will point in a direction that is perpendicular to the $x$-$y$ $plane$. $F$ therefore points in a direction parallel to the $z$ $axis$. This leaves us with a question. In which direction does $F$ point? $-z$ $axis$ direction or $+z$ $axis$ direction. Using the $Right$ $Hand$ $Rule$, one can easily solve this issue. 

Look at the diagram below,

![enter image description here](https://i.stack.imgur.com/ziWVj.jpg)

Place your right hand on $v$. Now, curl your fingers in the direction of $B$.

![enter image description here](https://i.stack.imgur.com/l3QrL.jpg)

Here, $B$ is considered to be coming out of the screen. As you curl your fingers, you see that they are also coming out of the screen( in the direction of $B$ ). The thumb points in the direction of $F$. If $B$ were considered to be going into the page, $F$ would have pointed downwards.

Remember, I worked with a ***proton***. If one works with an electron, one has to flip the direction of the force due to its opposite nature.