What instruments do they use? How do they calculate it, roughly speaking?
Because we have knowledge of the exact positions of the sun, moon and earth to very high precision going out many decades. These orbits are perturbed by the existence of the other planets, but computer models can easily account for all that and calculate the orbit to high precision.
It helps that these things are kind of far away from each other. The same kinds of computer models can predict the positions of satellites orbiting close to the earth, which are perturbed not only by the sun and moon (and a tiny bit by the planets), but also by irregularities in the earth's gravitational field caused by the earth being non-spherical and having mass concentrations like mountain ranges.
These perturbations are big enough that the agencies that track stuff in orbit around the earth send out orbital updates EVERY SINGLE DAY to keep everybody's models up to date with enough precision (frequently we're interested in knowing where satellites are down to small fractions of a meter. We don't need that much precision on the moon's position to predict an eclipse).
The positions of the sun, moon, Earth and all the other planets, plus a lot of the asteroids, have been pined down accurately for decades. A lot of that is from telescope observations, especially since cameras were attached to them over 100 years ago. Then starting in the 1960's we used radar to measure the distances to Venus and Mars. Combining everything, we got really good equations for how they all move around.
The only really hard part is predicting the earth's rotation, so that we can figure out the longitude of the Moon's shadow on the Earth. Predicting that for 1000 years in advance (for example), includes an error of about 35 kilometers.
A solar eclipse happens when the moon is directly covering the sunlight. It does not happen every month though, as the moon is elevated 5 degrees from the direct sun's path. So it is easy to predict when will the moon delevate 5 degrees.