Note first that the result as stated is not true, as it fails for $n=0$ (a group of order $p^0=1$ clearly has no element of order$~p$). This is not a big deal as it suffices to add $n>0$ to the hypotheses, but it does point to a strange aspect of the problem statement: what really matters for the conclusion is the presence of at least one prime factor $p$ in the factorisation of $|G|$ (assumed finite), not the absence of other prime factors, which is really all that the given hypothesis states. In fact Cauchy's theorem says that whenever $|G|$ is divisible by a prime number$~p$, there is a element of$~G$ with order$~p$.$\def\ord{\operatorname{ord}}$
This being said, the absence of other prime factors does make the proof easier, since one does not have to go searching for an element whose order contains a prime factor$~p$: every element $a\neq e$ will satisfy that property (and such$~a$ exists provided that $n>0$), since its order cannot contain any other prime factors. This is what the hint and application of Lagrange's theorem give; so far your approach is fine.
Where you go somewhat astray is in analysing the situation inside the cyclic group $\left<a\right>$. It is a general fact that in searching for an element of order$~d$, it matters little if one actually finds an element$~a$ whose order is a multiple of$~d$: if $\ord(a)=md$ for some $m\in\Bbb Z$, then $\ord(a^m)=d$ as one easily checks, and one can take $a^m$ instead of$~a$. Stated differently: a cyclic group of a given order$~k$ contains a cyclic subgroup of every order dividing $k$ (indeed it contains a unique such subgroup, though that is not used here). Concretely, if your element $a$ has $\ord(a)=p^l$ (the only possibility, since all divisors of $p^n$ are again powers of$~p$) with $l>0$, then $\ord(a^{p^{l-1}})=p^l/p^{l-1}=p$, so the element $a^{p^{l-1}}$ answers the question.