Slang is just new words or phrases that develop out of popular culture. Some slang will stick around and eventually become part of the English language. Other slang will eventually disappear from current use but will remain in books to puzzle future generations.
Some slang terms are inappropriate for most use outside of bantering with friends, but typically these refer to acts that you shouldn’t be discussing with any but your best friends or your significant other. Others are just quite informal and so shouldn’t be used in an office setting or other formal situation.
An example of out-dated slang would be groovy (still in use but no longer considered “cool”). Another would be the word cool, which has become almost accepted fully into the English language. There are quite a few from the 1920s here. Some of these terms have entered American English so much so that they are no longer considered slang (an informal nonstandard variety of speech characterized by newly coined and rapidly changing words and phrases, generally considered inappropriate for formal use) but are classified as idioms (linguistic usage that is grammatical and natural to native speakers but that may have different meaning from the one suggested by the individual words such as raining cats and dogs)
Basically, if it is in the Urban Dictionary or refers to sex or body parts, you don’t want to use it in a job interview, a speech, or in speaking to potential in-laws. Can ya dig it?