Load the song containing your chosen drum beat into your sampler. If you're using a computer-based unit, simply drag and drop your song files onto the sampler. If you're using a hardware unit, connect the inputs on the rear of the sampler to the output of a playback device like a CD player or turntable. Press play on the playback device and record on the sampler. When you've captured the section you want, hit stop.
Strike the playback button on your sampler to hear the section of drumbeat you've captured. It should be longer than the loop you plan to use, requiring you to trim off some excess to make it loop properly. Engage the sampler's "Loop" mode, which will cause the section of audio to repeatedly play in a loop. This will make it easier to judge that the ends of the loop are positioned correctly.
Move the start and end points of the loop using the "Start" and "Stop" controls. A drum beat should always start on the "One" count of the measure. Loops are likely to be four, eight or 16 bars long. Save the sample and repeat the process. Listen throughout the song for any variations on the drum beat, such as a double-kick drum or a fill at the end. These will give you alternate beats to use for different sections of the song.