How do you calculate the p-value in a hypothesis test?
p-value is the probability of getting as or more extreme sample, as observed, if null hypothesis was true. We test this in the direction of alternative hypothesis.
For example: if we test
(probability is obtained from test-statistics distribution, here it came from z-table).