>>516057471
There’s a couple methods, one is you look for orbital wobbling, a particularly massive planet will tug on their star and cause it to shift, you can then use that to determine its radial velocity thanks to the Doppler effect. You can look for transits, that is when the planet passes in front of their star. This allows us to determine radius, and we can determine its composition with spectography, different elements produce different spectrums of light. If you catch a transit and detect wobble you can fairly accurately determine mass. It’s not a perfect system though, but as a ballpark estimate it’s fairly reliable.