안녕하세요. = Hello. / Hi. / How are you?
안녕 + 하세요 = 안녕하세요.
an-nyeong + ha-se-yo = an-nyeong-ha-se-yo
안녕 = well-being, peace, health
하세요 = you do, do you?
안녕하세요 is the most common way of greeting someone in Korean and it is in formal or polite way.
And when you say “Good-bye” in formal/polite Korean, there are two types of expressions, and both of these expressions have the word 안녕 an-nyeong.
1. If you are leaving, and the other person is staying, you can say:
안녕히 계세요. an-nyeong-hi gye-se-yo
2. If you are staying, an the other person is leaving, you can say:
안녕히 가세요. an-nyeong-hi ga-se-yo
Hope it will help you =)