They are used for answering yes/no questions. Practically, you can use them alternatively. In fact, meanings of these words are a bit different:
HAYIR (=no) X EVET (=yes)
YOK (does not exist) X VAR (=exists)
I believe the nuance between them, is not very important. Mainly, using `Yok` instead of `Hayir` or vice versa is more accurate in some situations. But i really believe that, if you are answering a yes/no question, you can use them alternatively:
- Araban var mı? (=Do you have a car?)
- "Evet, var" or "Evet" or "Var" (=yes, i do)
- "Hayır, yok" or "Hayır" or "Yok" (=no, i don`t)
- Ödevini yaptın mı? (= Did you do your homework?)
- "Evet" or "Evet, yaptım" (=yes, i did)
- "Hayır" or "Hayır, yapmadım" or "Yok, yapmadım" or "Yok"