Sampling has always been a controversial subject. Some people say that by taking a portion of someone else’s work you are stealing it. Others say that it is just another form of appropriation, which is evident in art throughout history. The fact of the matter is that there are only so many ways you can arrange 12 notes, and any song could be ripped apart to reveal a borrowed melody... intentional or not. The difference here is that sampling is the act of taking a portion of a sound recording that someone spent money creating in a studio & reusing it. Sound recordings are protected by copyrights, so you are entering some murky water when you rip sounds from another artist. Even if you completely take it out of context.
Regardless of how you view sampling, if you plan on creating a record with samples on it you need to start contacting some copyright holders. For each sample you need two clearances: One from the copyright owner of the song, and one from the copyright owner of the master tapes. You can search the databases of the different performing rights organizations to find the rights holders for any song. Once you find the correct person you will need to ask them to grant clearance for the music to be used on your record. Make sure you have this in writing & in very clear terms. Some detailed advice can be found here: http://www.nolo.com/legal-encyclopedia/how-obtain-sample-clearance-29725.html
Just to reiterate how strict the law interprets copyright infringement, a copyright case involving sampling held that even sampling three notes could constitute infringement (Bridgeport Music Inc. v. Dimension Films). There are hundreds of examples of artists that have used samples without clearance only to find themselves with a mountain of lawsuits. I’m certainly not telling anyone how to express themselves, and don’t mistake this for legal advice. Sampling is so common that many young musicians don’t even realize the legal ramifications. Just be aware of what you are doing.