A maximal subgroup of a $p$-group contains all commutators and $p$-th powers of elements

Let $ G$ be a p-group and $ M\subseteq G$ be a maximal subgroup. Show that $ M$ contains all commutators and $ p$ -th powers of elements of $ G$ .

My attempt

The commutators are elements of the form $ [x, y] = x^{-1}y^{-1}xy$ , for $ x, y\in G$ . So we essentially need to prove that the commutator subgroup $ G’ = [G, G]$ and the set $ \{x^p: x\in G\}$ are both contained in $ M$ .

I think the fact that $ M$ is normal and is of index $ p$ might be useful. From this we can also deduce that $ G/M$ is a cyclic group of order $ p$ .

But I can’t really see how to draw the connections between these observations and the desired result.

Any help would be greatly appreciated.