If you want to play samples other than your own playing, you need a looper that you can connect to a computer, so you can add audio files that you have already recorded.
OR, you can play the relevant instrument into the looper, and save your work at the appropriate tempo.
http://looperpedalreviews.com/ is a great place to read about loopers.
I use a Boss RC-300, which is initially complex to understand, but I think is the daddy of loopers for ease of use live.
There are tons of YouTube videos on looping, with some amazingly talented people.