happy_birthday :- read(Name), write('Happy Birthday '), write(Name), write(' '), nl.
Read this as:
To do happy_birthday: Read a name from the terminal; write 'Happy Birthday '; write the name; write one space; move to a new line.
Prolog always executes the tail of a clause from left to right, as in conventional programming languages.