I would probably start with something along the lines of this:
I like to find a perfect 2 bar (or whatever length is appropriate) looping section in the sample editor, then "selection to region" in one of the sample editor menus, then do the above.
You'll get less accurate results trying to tap tempo (assuming you are a person), but this is Logic's device for that (I don't like it, but my controller has a tap tempo so I've never mastered Logic's).
If you've got a part that doesn't stick to a tempo - speeds up a little, slows down, etc. - then that's where beat mapping comes in to play. Type it into the search box of the manual for further reading.