You can find some tutorials on it, such as:
Using Tilt-Shift Lenses to Control Depth of Field
The idea is that as you tilt the lens, draw a line from the focus plane (the sensor plane) of the camera and another line through the plane representing the front-most element of the lens. Where these two planes intersect you can treat as a "hinge" point. As you focus the lens in and out, the "hinge" will stay pinned to that point... but the rest of the plane of focus will swing out.
The tilt-angle on a tilt-shift / perspective-control lens will have index marks to indicate the tilt angle in degrees. There is a math formula for it:
tilt-angle = arcsine ( focal length (mm) / distance of lens axis to the focal plane (mm) )
By "distance of lens axis to the focal plane" I am referring to that "hinge point".
I have tested my tilt-shift lens strictly by the math. E.g. I took a persian rug (intricate pattern on the floor). I put the camera about 10" above the floor (300mm). It's a 24mm tilt-shift lens.
So... 24 / 300 = .08
arcsine(.08) = 4.6º
So I tilted the lens to 4.6 (which is hard to judge... it was about 4 1/2º), focused it, and took the shot. The entire surface of the rug was in sharp focus... near to far.
Most photographers will skip the math and just iterate their way to focusing the lens. (focus far, tilt to bring the front to focus, which throw the back focus off again... re-focus... re-tilt... take the bloody shot already)