The trick is noticing the dependence on $z$ if you will. Let us review first the right hand rule, the usage is simple, open your hand completely and place the center of your palm at the charge/orgin depending on the case, point your fingers in the direction of the first vector (the pointing, middle, ring and little fingers) while keeping your thumb extended. Then close your fist towards the direction of the second vector (this should only be possible in one of two ways) then your thumb should be pointing towards the result of $\vec{a}\times\vec{b}$.
Now for the case at hand we want $\vec{B}$ so by using Biot-Savart's Law, you can do the following: imagine you are looking at a cross-section of the slab (the plane $YZ$) and picture the current(s) as many lines (vectors) coming out of the page from every point within the cross-section of the slab (that is arrows just coming towards you).
Now every such arrow produces a magnetic field around it pointing in anti-clockwise direction, as stated by the r-h-r. If they were all the same you can see they would cancel with their neighbours. The only contributions would occur towards the edges (but forget about those for now). So in the interior all this little circling magnetic fields cancel each other in principle. However, notice that when you start increasing $z$, the current gets stronger meaning the magnitude of this little magnetic fields too and now the lower parts are not as strong as upper parts, so they wont cancel out (while left and right parts will still cancel). All in all you will add everything to obtain many contributions pointing towards the $-y$ direction.