You’ve just said a Torah blessing, or given a drash [short speech about Torah] or helped with something around the synagogue. Suddenly people are sticking their hands out to you for a handshake and saying “Ya-sher KO-ach!” with great enthusiasm. What the heck?
Don’t worry, you haven’t done anything wrong; just the reverse, they’re congratulating you on a job well done. “Yasher koach!” translates, literally, “May your strength be firm!” but it’s an idiom meaning, “Good job!” and it carries with it the hope that this mitzvah will give you the strength to carry on to future mitzvot. Think of it as a cheer.
It has a lot of variant pronunciations: YA-sher KO-ach, Y’Sh’KOICH, YA-sher-KOYch, and so on. The grammatically correct form when addressing a woman is “Tashiri kohech” but usually you’ll hear the masculine. I do not correct the grammar when friends say “Yashar koach” to me – it’s a compliment, just accept it!
The polite thing to say in return is “Baruch Tihiye” (Ba-rooch tih-hee-yeh). That means “blessed you will be,” which might translate colloquially as “Back atcha!”