According to my lecture notes, for a subgroup $H$ of a group $G$, the (right) cosets of $H$ in $G$ are all the sets given by $$ Hx = \{hx: h \in H\} $$ Where $x \in G$.
This implies that the number of cosets would be given by $[G : H]= |G|$.
However, Lagrange's Theorem states that $[G:H]=\frac{|G|}{|H|}$.
Why is this the case?
When you list the right cosets as $Hx$ for all $x \in G$ there are repetitions: we have an equality $Hx = Hy$ whenever $xy^{-1} \in H$. In particular, there are precisely $|H|$ repetitions of the identity coset $H = He$ that appear in the list. This is a general phenomenon, as evidenced by the fact that all the cosets are in bijective correspondence, and so you have to divide $|G|$ by $|H|$ to account for the repetitions.