“Yeah, good luck with that.”
Your friend isn't a very good singer, but he tells you that he's going to enter a singing talent show. He says that he's sure that he'll win first place. You don't think that's possible. You say this under your breath (quietly, so he can't hear).
Yeah, good luck with that.
"Good luck" is a phrase you say to someone to encourage them for something they're going to try to do. Before someone takes a test, applies for a job, or tries to write a novel, you can say:
If you want to specify what you're wishing them good luck with, you can say "good luck on (something)":
Good luck on your job search!
"Good luck with that" is a set phrase that people say when you're going to try something that they think will be hard or impossible.
The literal meaning of "good luck with that" is simply, "I hope that you succeed with that." However, this phrase has become popular to use sarcastically. So it often means "I don't think that you're going to succeed."
Any kind of sarcasm should be used carefully, and only with people who you're close with.
If you sincerely want to wish someone good luck, you can simply replace "that" with a longer phrase:
Good luck with the competition!
You can also use "on" instead of "with":
Good luck on your exams.
Sometimes we use "Yeah" sarcastically. This means that you actually disagree with what a person has said, but instead of saying "No" you say "Yeah". For example:
A: I'm sorry!
B: Yeah, right. That's what you always say.
A: I'm going to beat you. You don't stand a chance!
B: Yeah, we'll see.