To greet someone as a friend or more respectfully is something I will always get wrong sometimes.
In Spanish there are 2 different words for “you” Tu and Usted, and the difference is quite important. Usted is a formal and Tu is a friend or someone much younger than you.
Once you understand that you should be ok.
Hola. ¿Que tal? is the most common greeting “hi. How are you?” you will encounter which you should respond muy bien (very good). Unless you want to hear all about peoples problems I would just keep to hola. I have a friend who pops in twice a week or so to tell me about his sciatica and diabeties ever since i said Que tal. You have been warned, friends will tell you things that are wrong about themselves.
In a more formal setting use Buenos, Buenos días or Buenos tardes instead depending on the time of day. Buenos días seams to be used until 5pm ish and tardes afterwards. If you arn’t sure, do what I do and use Buenos.
Mañana is Morning / Tomorrow
Día is Daytime / Day,
Tarde is afternoon / Late
but notice the “s” on both the greeting. “s” on the end of a word means plural so why is it there? Well I really don’t know. Maybe someone does and can post the reason in a comment below.