It is understandable to feel confused about hypothesis testing, as it can be a complex topic. However, it is important to clarify some concepts to better understand the formula and how to use it in hypothesis testing.
Firstly, the formula you mentioned is the formula for the z-test, which is used to test hypotheses involving a population mean when the population standard deviation is known. This formula is used to calculate the z-score, which is then compared to a critical value to determine the statistical significance of the results.
Secondly, when conducting a one-sided test, the alpha level is typically set to the desired level of significance (e.g. 0.05 or 0.01). This means that the calculated z-score needs to be equal to or greater than the critical value in order to reject the null hypothesis. However, for a two-sided test, the alpha level is divided by 2 and used for both tails of the distribution. This is because a two-sided test is concerned with the possibility of a significant difference in either direction, so we need to account for both tails of the distribution.
In summary, for a one-sided test, the formula is set equal to the alpha level, and for a two-sided test, the formula is set equal to alpha/2. I hope this helps clarify your confusion about hypothesis testing. Remember to always carefully consider the type of test you are conducting and the appropriate alpha level to use.