Calculating the mass of celestial bodies

So I’m writing this paper and a part of it is about calculating the mass of celestial bodies.

One of the methods use radio telescopes, the whole idea is that you use the telescope to see how for example a planet is effecting it’s moon.

But I don’t get how we’d know the mass of that moon using this method.

If anyone knew and had the time I’d greatly appreciate an explanation.