Can I use samples to make my own song?

Can I use samples to make my own song? Am I violating copyright?

As i know in free library and bought sound royalty free. Can use in your production