Cut the sample so that it starts immediately on what you want to be the first beat of the measure. To do this accurately, you need to zoom in on the audio file until you can see exactly where the sound wave begins.
Cut the end of the sample so that it ends exactly where you want it to loop back to the beginning. As with step one, you need to zoom in to do this part right.
Highlight a region that starts where the sample begins and ends on the first beat of whatever bar is closest to where your sample ends. The region locator is the green bar that you can draw along the top of your "Arrange" window to set a loop length. You can also experiment by setting the region locator to half, or twice, that length.