Assuming you know the mean (mu) and the standard deviation (sigma), you would use the raw score (x) to get the z score through this formula
z = (x-mu)/sigma
If you get a positive z value, then the raw score is above the mean. If z is negative, then the raw score is below the mean.
The absolute value of z tells us how far away from the mean we are in terms of standard deviation.
Eg: z = -3 leads to |z| = |-3| = 3, so we're 3 standard deviations below the mean.