Listen to the piece. Pay attention to the rhythms and look for things that stand out such as the chorus is louder than the verse or the bridge seems twice as fast as the previous part. Pay attention to the time signature, as this will influence the drum part you write.
Lock into the tempo. One of the main duties of a drummer is to provide good time-keeping skills. Before you can do flashy fills, you need to be able to keep good time. Get familiar with the tempo of the song. If necessary, just tap along to the song to get comfortable with the tempo.
Play a basic part. Play something that locks into the tempo and feel of the song. If the guitars are playing a quick, distorted riff, consider opening the hi-hats to give a heavy swooshy sound. If horns are providing a slow melody, consider playing the ride cymbal slowly and lightly to match their tone and feel. Experiment until you find the best part.
Add fills and accents if necessary. Fills do just that—they fill space between parts. They help to transition from one section to another. Accents are anything played louder than the normal volume of the part. If the rhythm or feel changes from one part to another, add a fill to help transition between the parts better. Try to work together with the other players so your parts blend well.
Practice the part you wrote. Continue to make changes as necessary. Be open to ideas and suggestions from others.