You can calculate the speed and orbital trajectory of any object in the solar system just by observing its position at two different points over a given period of time (e.g. two consecutive nights). Then it's just a matter of doing the maths. Comet C/2022 E3 had been observed for around 9 months...