It depends
There are formal and informal address, and it changes according to the time of day. Probably the best to learn first would be:
Guten Tag (hello , formal, usually used in the morning but I've used other times of day too)
Guten Nachmittag (formal, good afternoon)
Guten Abend (formal, good evening)
Hallo ( hi, informal, all times of day)
Auf Wiedersehen (goodbye, formal)
Tschüss (goodbye, informal)
There's also many other ways of saying hi and bye, and it can change according to the region or area you are in. It's pretty interesting