Watch any anime for ten minutes and someone will say it. A monster appears — やばい! The food is delicious — やばい! The test is tomorrow — やばい…. One word, opposite meanings. Here's how that works.
The original meaning: danger
やばい started as slang for “dangerous / risky” — the feeling of “this is bad, I might be in trouble.” That's still its core meaning.
The modern meaning: anything extreme
Then young speakers flipped it: now やばい also means “insanely good.” The logic is the same — the situation is too extreme to be normal. English did exactly the same thing with “sick” and “insane.”

この ケーキ、やばい!

Good yabai or bad yabai?

おいしい やばい!
The delicious kind!
Can I actually use it?
With friends — absolutely, it makes you sound natural. But it's casual slang: don't aim it at your boss, your teacher, or a job interview. The safe polite stand-ins are すごいですね (amazing!) and たいへんですね (that's rough).
