Here is a script that evaluates the density.
Are there restrictions on what the allowed values are for m?
Your formula gives density=∞ at z=0. It gives complex numbers for z<0, for most values of m. That makes me wonder if the formula is really correct.
If you want a random sample, then you would need to know the inverse of the distribution function. The you could draw a random number, p, from U[0,1) and then find the inverse from the inverse distribution function. That is the z value corresponding to point p on the distribution. Do that many times. Then you can plot the histogram of the z values you have obtained. But you can't do any of that, because you do not have the inverse distribution function for this density.