Congratulations on recognizing the problem. I think that's the crucial step to avoiding it.
Writers, especially new writers, often seem to have the delusion that everyone in the world lives in exactly the same cultural bubble that they do. They assume, for example, that everyone likes the same bands that they do, and that if they quote a line from their favorite song every reader will instantly recognize it and that it will bring all the same associations to mind that it does for the writer.
Or as with your question, they assume that a slang term used by people in their group is recognized by everyone in the world.
Simple solution: avoid slang.
Ok, sometimes you need it to set the tone or be true to the setting. A group of teenagers who never use slang might seem unrealistic. Though in practice, I think writers who say this exaggerate the problem. Yes, maybe teenagers in such-and-such a place would really say, "Wow, that frab was totally the horge!" But if you have them say, "Wow, that ball game was really exciting!", how many readers would find this unbelievable, or even particularly notice?
If you find it desirable to use slang, introduce it in a way that makes it clear what it means. Sometimes this is easy. A large percentage of slang is just alternate words for "good" and "bad". So if I read, say, "All right!! That was like, totally perpendicular, dude", I'd take it that "perpendicular" here is a slang term for "good".
If it's more specific, either define it, or make it clear from context. Like if a character says, "I saw a zube yesterday", well, that could be anything from a kind of animal to a movie to a phase of the moon. Instead, the first time you use the word, wrap it in a context that defines it. Preferably without actually saying, "this is what this word means". Like, say, "We're going to a zube by that new band tonight. I really like their music." Now the reader can readily guess that it's some sort of concert.
But for the most part, I'd say to simply avoid slang. To the reader who is not familiar with the slang words, it really stands out and, in my humble opinion, does more to distract from the story than to establish the setting.
Also, slang tends to be very transient. The slang that was popular 20 years ago sounds very old-fashioned today. When I was a teenager, we said that things were "groovy" and "hip". Use those words today and you sound like a refugee from the 70's. I'm sure that whatever slang kids are using today will sound very dated in 20 years ... or six months.