In live performance, it is often necessary to play in time with a pre-recorded track. This could be a loop perhaps, or in musical theater it could be chorus track that is played when a group of dancers are pretending to sing (dancing and singing at the same time is difficult). All the live instruments need to play in time with the recording, but obviously it is the drum set that is most important.
A similar situation sometimes happens in the studio. You might, for instance, have recorded a track with sequenced drums, but find that the sequenced drums don't sound live enough. Plainly, overdubbing a real acoustic kit would be the solution.
In either case, the traditional solution is to feed the drummer a 'click track' on headphones. A click track can be something as simple as a metronome tick, and indeed this is often done, but there is a problem with this…
If you have a click on each beat of the bar, the drummer will also be playing something on each beat that will obscure the click. So when the drummer is in time, he can't hear the click. It is only when he is out of time that the click is audible.
You have to try this to realize how uncomfortable it is. You almost want to play out of time just to check that the click is there. What we need therefore is a better click track.
It helps to use a sound for the click track that is dissimilar to the drum sounds being played – a cowbell or wood block for instance. It also helps not to make the sound too incisive. If the sound has a sharp attack but little 'body', then it will have to be played loud in the headphones to be heard, which is wearing on the ears.
The second trick is to use the in-between beats. In a typical four-beats-to-the-bar rhythm, also place clicks not only on the beats but on the eighth-notes in between. You can use different sounds to indicate the difference, and also use a distinctive sound for the beginning of the bar. You can be quite creative about this – whatever click track rhythm helps the drummer lock on to the rhythm of the song is what you are looking for.
Commonly, recordings made using click tracks are in 'strict tempo', meaning that the tempo never varies, but of course this doesn't have to be so. I remember in the days before sequencers that I used to construct click tracks by editing tape. I would run a metronome at different speeds to create the different tempos I needed, and during an accelerando or rallentando I would edit individual beats together. It's not too precise to go to these lengths if you have a particular result you want in mind.
Get the click track right and the drummer will love you for it.