Suppose that $K \leq H_1 \leq H_2 \leq G$, and that $K \trianglelefteq G$ and $H_1 \trianglelefteq H_2$. Using only Lagrange, show that $[H_2 : H_1] = [H_2/K : H_1/K]$.
(It's not enough to just write down some big fractions and cancel the $K$'s.)
Theorem 6.10 Lagrange. Let $G$ be a finite group and let $H$ be a subgroup of $G$. Then $|G|/|H| = [G : H]$ is the number of distinct left cosets of $H$ in $G$. In particular, the number of elements in $H$ must divide the number of elements in $G$
$$ \begin{aligned} .[H_2 : H_1] &= \frac{|H_2|}{|H_1|} \\ &= \frac{|H_2|}{|K|} \cdot \frac{|K|}{|H_1|} \\ &= \frac{|H_2|}{|K|} \div \frac{|H_1|}{|K|} \\ &= \frac{|H_2/K|}{|H_1/K|} \\ &= \left|\frac{H_2/K}{H_1/K}\right| \\ &= [H_2/K : H_1/K]. \end{aligned} $$
Im not sure if what i did was correct and I also didnt use only Lagranges theorem. is this a good proof ?
As long as $H_2$ is finite, your use of Lagrange's theorem is correct. When in doubt, say explicitly the reason behind each deduction you made: $$ \begin{align*} [H_2:H_1] &= \frac{|H_2|}{|H_1|} \tag{Lagrange} \\ &= \frac{|H_2|/|K|}{|H_1|/|K|} \tag{$|K|\ne 0$} \\ &= \frac{[H_2:K]}{[H_1:K]} \tag{Lagrange} \\ &= \frac{|H_2/K|}{|H_1/K|} \tag{$K\unlhd H_1$ and $K\unlhd H_2$} \\ &= [H_2/K:H_1/K] \tag{Lagrange} \end{align*} $$
Now, if $H_2$ is infinite, then the finite version of Lagrange theorem cannot be applied. In this case, it is also hard to apply the infinite version, at least to me. One way is to simply construct an explicit bijection between the two quotient groups. Define $\phi:H_2/H_1\to (H_2/K)/(H_1/K)$ by $$ \phi(aH_1)=(aK)(H_1/K) $$ for all $a\in H_2$. The map is well-defined and injective because for all $a,b\in H_2$, we have $a^{-1}b\in H_1$ if and only if $a^{-1}bK\in H_1/K$. It is also clearly surjective. The required formula is thus proved.
By the way, $\phi$ is actually a homomorphism, so it shows that $H_2/H_1\cong (H_2/K)/(H_1/K)$. This is known as the third isomorphism theorem.
Instead of doing it all at once, the map $\phi$ above can be constructed fairly naturally: $$\require{AMScd} \begin{CD} H_2 @>{\pi_2}>> H_2/K\\ @V\pi_{1} VV @VV\pi_3 V \\ H_2/H_1 @>{\phi}>> \frac{H_2/K}{H_1/K} \end{CD} \tag{1} $$ Well, this might be a bit stretching for a beginner, but let me explain.
First, there is actually a defining property of "taking a quotient", called the universal property of quotient groups:
Despite being a big chunk of statements, it's not that hard to understand and prove. The main takeaway is that, given a homomorphism $f$, under certain condition, we can decompose it as $f=\phi \circ \pi$ for some homomorphism $\phi$. It is as if we are doing factorization of homomorphisms.
Back to the $(1)$ above. The $\pi_1,\pi_2,\pi_3$ are canonical projections (the maps that send a group to its quotient group). These projections are always surjective (not hard to show), and the kernels of these are always the normal subgroups that are being modded.
We can now apply the universal property, choosing $G=H_2$, $H=(H_2/K)/(H_1/K)$, $N=H_1$, $f=\pi_3\circ \pi_2$ and $\pi=\pi_1$. It is not hard to verify that $\text{ker} f=H_1$. Now, we can then decompose $f$ as $f=\phi\circ \pi_1$. From the fact that $\text{ker}(f)=H_1$, $\pi_1$ is surjective, and $\text{ker}(\phi\circ \pi_1)=\pi_1^{-1}(\phi^{-1}(\{H_1/K\}))$, we can deduce that $\text{ker}(\phi)=\{H_1\}$, which is the trivial group in $H_2/H_1$. This shows that $\phi$ is injective. Also, $\phi$ is surjective because $\pi_3\circ \pi_2$ is surjective ($h\circ g$ surjective implies $h$ surjective). This shows that $\phi$ is a bijection, as desired.