How to understand definition of $\Pi_k$ in arithmetical heirarchy
For $k$ even, a language $L$ is in $\Pi_k$ if there exists a recursive predicate $R$ such that
$$
x \in L \Longleftrightarrow \forall y_1 \exists y_2 \cdots \forall y_{k-1} \exists y_k \, R(x,y_1,\ldots,y_k)
$$
The quantifiers alternate between $\forall$ and $\exists$.

When $k$ is odd, the same definition works, but the last quantifier is $\forall$:
$$
x \in L \Longleftrightarrow \forall y_1 \exists y_2 \cdots \exists y_{k-1} \forall y_k \, R(x,y_1,\ldots,y_k)
$$

For example, the language of all total Turing machines is $\Pi_2$ since
$$
x \in \mathsf{TOT} \Longleftrightarrow \forall y \exists z \, \text{"Machine $x$ halts on input $y$ within $z$ steps"}
$$

The class $\Sigma_k$ is defined in the same way, with the first quantifier being $\exists$ rather than $\forall$.

If you complement a language in $\Sigma_k$ you get one in $\Pi_k$, and vice versa. This is due to de Morgan's laws for quantifiers, and the fact that the negation of a recursive predicate is also recursive.

For example, the language of non-total Turing machines is $\Sigma_2$ since
$$
x \in \mathsf{NTOT} \Longleftrightarrow x \notin \mathsf{TOT} \Longleftrightarrow \exists y \forall z \, \text{"Machine $x$ doesn't halt on input $y$ within $z$ steps"}
$$