The airplane does this for us nowadays with the magic of VNAV. However some basic rules of thumb are still used for manual descent planning. Common “3 to 1 rule” means that for every 1000 feet we need to lose it takes 3 nautical miles of distance traveled at a normal descent rate.
The reality is outside of using vnav a lot of it is just guessing. Nobody these days does any complicated math to calculate a perfect descent rate. Usually it’s just looking at our displays and seeing “oh shoot we aren’t coming down fast enough” and then doing things like increasing airspeed or using speed brakes to increase the descent rate until it looks right.
Once on final approach as others have said we then either are using vnav, an ILS glideslope, or visual lights to descend perfectly to the runway. There’s tables available for your ground speed and the optimal descent rate for a particular glide angle (normally 3 degrees) but nobody really uses them these days because the descent rate rarely changes all that much.
Latest Answers