In this video Number Theory | Chinese Remainder Theorem: Example 2
following steps are mentioned
$$42x \equiv 1 \pmod 5\\ 2x \equiv1 \pmod 5$$
and $$ 35x \equiv 1 \pmod 6\\ 5x \equiv 1 \pmod 6 $$ so on...
How he goes from $42x$ to $2x$ and from $35x$ to $5x$?
If there is any theorem, are there any tricks / techniques to calculate those fast?