# How do you calculate the p-value in a hypothesis test?

For example: if we test ${H}_{0} : \setminus \mu = 10$ vs ${H}_{a} : \setminus \mu > 10$, and we get test statistic $z = 1.96$, then p-value is the probability of getting this test statistic in the direction of alternative hypothesis, i.e, p-value = $P \left(Z > 1.96\right) = 0.025$