We're given that
$$2^{n-1} \equiv 1 \pmod{n} \tag{1}\label{eq1A}$$
Let $k$ be the multiplicative order of $2$ modulo $n$, i.e.,
$$\operatorname{ord}_{n}(2) = k \tag{2}\label{eq2A}$$
From \eqref{eq1A}, we get
$$k \mid n - 1 \;\;\to\;\; k \mid ph \tag{3}\label{eq3A}$$
since, otherwise, there's integers $j$ and $r$ where $n - 1 = jk + r, \; \; 1 \le r \lt k$, which gives $2^{n-1} \equiv (2^{k})^j(2^r) \equiv 1(2^r) \pmod{n}$, so $2^r \equiv 1 \pmod{n}$, contradicting that $m = k$ is the smallest positive integer where $2^m \equiv 1 \pmod{n}$.
Since we're given that $k \not\mid h$, then this with \eqref{eq3A} means $p \mid k$, i.e., there's a positive integer $j$ where
$$k = jp \tag{4}\label{eq4A}$$
Also, the third paragraph of the Properties section states
As a consequence of Lagrange's theorem, the order of $a \pmod{n}$ always divides $\varphi(n)$.
Note $\varphi(n)$ is Euler's totient function, for which we have
$$\varphi(n) = \prod_{i=1}^{m}p_i^{e_i - 1}(p_i - 1) \;\;\text{where}\;\; n = \prod_{i=1}^{n}p_i^{e_i} \tag{5}\label{eq5A}$$
From \eqref{eq4A}, we have $k \mid \varphi(n) \;\to\; p \mid \varphi(n)$. Since $p \not\mid n$, then we must have $p \mid p_i - 1$ for some $i$, say WLOG $p_1$, so we get
$$p_1 = sp + 1 \tag{6}\label{eq6A}$$
for positive integer $s$. Thus, we have for some positive integer $t$ that
$$n = (sp + 1)t \;\to\; ph + 1 = tsp + t \;\to\; (h - ts)p = t - 1 \tag{7}\label{eq7A}$$
Note the stated condition $h \lt p$ means $n \lt p^2$, but $t \ge p$ means from \eqref{eq7A} that $n \gt p^2$, so we must have $t \lt p$. Since the right side of the above equation shows $p \mid t - 1$, then $t = 1$. Thus, $n = p_1$, i.e., it's a prime number.