When you talk about the subject, you use”ha” but the pronunciation is “wa” because it’s easier to say it than “ha” I think. こんにちは originally means “today (今日は) and people used to say something like こんにちは、お元気ですか?(how are you today? )or こんにちは、お天気が良いですね (it’s so nice today, isn’t it?) when they greet each other. (We still say that in this day and age though.) From Meiji era, people started to use just こんにちは as a greeting word, same as こんばんは. (I googled it)
I hope it helps!