First say konnichiwa (hello) then most likely you will hear konnichiwa, genki(g as in egg enki) desu(dess) ka (hello how are you?)
You should answer genki desu, arigato, anata wa(im fine, thanks, how about you) then you should hear watashi mo genki desu, arigato(im fine too thanks) konnichiwa is used at midday-sunset, ohayo gozaimasu is good morning, konban wa is good evening.
Also if you are older than someone you can tell them ohayo instead of ohayo gozaimasu. Also when you say someone's name follow it by san, kun(young boy), chan(young girl) or sensei(teacher).