Its a touch thing, just like playing pinpoint position. It takes practice like anything else. Basic speed control practice drills work fine. Personally I have a tendency to play a several inches long when trying to glue the next guy to the rail, especially on shots where the cue ball is travelling nearly the length of the table. I simply pick a spot a few inches short of the rail and generally get them tight to the cushion. Comes up all the time in snooker where a safety can simply be leaving distance and the white on a cushion to take away the opposition being able to play with side spin and snooker you back. Its a very handy skill to have...ive yet to meet anyone who enjoys playing frozen to the cushion.