The particle は which is pronounced わ is used after the subject like わたしは (I)、あなたは (you) and the partcle を which is pronounced お is used after the object like にほんごをべんきょうします (study Japanese).
Sometimes we invert the words, for example, いっしょうけんめいべんきょうしました。にほんごを。and ロシアを旅行しました。わたしは。however, it's not unusual. The important thing is that they are subject or object.
About こんにちは and こんばんは, they are the words for greeting and thay came fron the particle は. I think remembering them simply would be better.
I hope this helps you and you can get better answers.