To release a song containing a sample you must be granted permission from rights holders that own the music composition as well as the rights holders that own the sound recording.
Sampling is when you reuse a portion (or sample) of a sound recording in another recording. For example, if you use the 1971 recording of Led Zeppelin's "When The Levee Breaks" as your drum track. That's generally not legal, unless you have permission from the original artist or owner of the copyright, (usually the music publishers) and the owners of the recording (usually the record label).