# Why do we take the absolute value in a hypothesis test?

Recently I studied the definition of p-value as

The p-value associated with a test is the probability that we obtain the observed value of the test statistic or a value that is more extreme in the direction given by the alternative hypothesis, when $H_0$ (null hypothesis) is true.

For a two-sided alternative, the p-value =$P_{H_0}[|T|\geq|t_0|]$ where $T$ is the test statistic and $t_0$ is the observed value of the test statistic. Why do we take the absolute values of $T$ and $t_0$?

The absolute value is taken merely to give a concise way to define extremes in both directions. So |T|>=|t$_0$| simply means T>=|t$_0$| or T<=-|t$_0$|.