When to use buen vs bueno
Buen, bueno, buena... the ending matches the noun it describes, as far as gender.
La niña buena = The good girl
El niño bueno = The good boy
When bueno comes before a masculine singular noun such as día, viaje, trabajo etc you drop the final 'O'.
Un buen alumno = The good student (male)
Una buena alumna = The good student (female)
"Buenos días - Good morning, Good day
Buenas noches - Good night
Que pase un buen día - Have a nice day
¡Buen viaje! - Have a nice trip (Bon voyage)
Buena suerte - Good luck!
Buen trabajo - Good job
Buen provecho - Enjoy your meal (Bon appetit)
Also, it's important to know that some adjectives change their meaning according to whether they are placed before or after the noun:
El es un buen hombre. This would indicate the man is a fine man, a good person.
Roberto es un niño bueno. This would indicate Roberto is a good boy, as in well behaved.
The differences are subtle.
Es una buena comida.
It's a good meal, indicating it looks good, it's healthy, etc.
Es una comida buena.
It's a good meal, indicating it tastes good, it was hearty, satisfying, etc.