USUALLY:
The core vocabulary you learn in any language course will not include informal words
In a novel, magazine article, or newspaper, language that is OUTSIDE quotation marks will not include informal words, unless it is written in the first person. Language that is INSIDE quotation marks may include informal words.
In a video or television show, you just need to be as alert as you can for body language and tone of voice that would tell a native speaker whether the speech is formal or informal.
In this passage from an (1893) novel, the words outside quotation marks are standard English, while the words inside are colloquial and contain many informal (and outdated) words, such as "bloke," "dandy," "mugs." The quoted passages contain bad grammar ("hadn' oughta made no trouble"). They many misspellings to indicate mispronunciations--"dat" for "that," "oughta" for "ought to," "dose" for "those," "hully" for "holy."
From "Maggie, A Girl of the Streets," by Stephen Crane
The two held a technical discussion.
"Dat bloke was a dandy," said Pete, in conclusion, "but he hadn' oughta made no trouble. Dat's what I says teh dem: 'Don' come in here an' make no trouble,' I says, like dat. 'Don' make no trouble.' See?"
As Jimmie and his friend exchanged tales descriptive of their prowess, Maggie leaned back in the shadow. Her eyes dwelt wonderingly and rather wistfully upon Pete's face. The broken furniture, grimey walls, and general disorder and dirt of her home of a sudden appeared before her and began to take a potential aspect. Pete's aristocratic person looked as if it might soil. She looked keenly at him, occasionally, wondering if he was feeling contempt. But Pete seemed to be enveloped in reminiscence.
"Hully gee," said he, "dose mugs can't phase me. Dey knows I kin wipe up deh street wid any t'ree of dem."