How do we calculate top of descent (TOD) in flight?
Any approximate method is going to vary for different types of plane, depending on their speed, altitude and descent rate, but here's how I figure it for my Cessna 172.

I know I'm traveling around 2NM a minute (actually a little slower), and I like to descend around 500 fpm.   

So if I have to drop 5,000 feet to pattern altitude, the TOD is 10 minutes out (5,000 feet / 500 fpm).   At 2NM a minute, that is 20 miles out.

So if I have my GPS / DME set to my destination airport, I am looking for both ETE: 10 min, and also Dist: 20 miles, then I start my descent.

Its approximate, but its pretty close for planning purposes.
Its always just:

[Altitude Drop] / 500 = Minutes
Minutes * 2 = Miles