Good positioning and movement aided by good anticipation is critical when the referee has to make an important decision after a quick attack. It is easy for the referee to be delayed with a quick attack and loses good proximity or angle because of it.
In the video below, the situation may look very common. But notice how the referee did not realize there was big space in front of the attacking team with a numerical advantage. Because he was slightly delayed, by the time he started moving, the attacking team had speed.
Although the challenge inside the penalty area between an attacker and the goalkeeper was not a foul, the referee did not have good proximity (and possible angle, either). Consider space and numerical advantage. Try to position closer to the attacking area because challenges in the attacking area are generally more impactful on the game outcome than those in the midfield.