In こんにちは(hello), it is pronounced like 'wa'. But in おはよう(good morning) its pronounced like 'ha'. Can someone explain the catch here(Please keep in mind that I'm an absolute beginner)?
You may know this because this is something you may learn on the very first day of learning Japanese, but there are two hiragana that are read in two ways depending on the context:
- は: usually ha, but when used as a particle, wa
- へ: usually he, but when used as a particle, e
See this question for the historical reason behind this rule: Why are the particles "は" (ha⇒wa), "へ" (he⇒e), and "を" (wo⇒o) not spelled phonetically?
So as a general rule, は that appears within an ordinary word (noun, adjective, verb, interjection, ...) is pronounced ha. However, there are a few tricky words that have been "fossilized after swallowing up a particle", and こんにちは is one of such tricky words. This は in こんにちは is etymologically the topic particle, so it's written as は and read as wa.
That doesn't mean you have to remember the etymology of all words. Fortunately, the number of such tricky words and expressions is not large. You can find the list here: Can any other characters besides は and わ be used interchangeably at the end of words?
(English also has a few funny words that has been fossilized after swallowing a basic function word, e.g., "nonetheless".)