Hearts and Flowers
There's a full guide on Bulbapedia, but here's some basic information for HG/SS.
It starts out with 70 happiness when it first hatches.
-Walking 256 steps with it gives it +1 happiness.
-Leveling up gains +5, +3, or +2 if its current happiness is from 0-99, 100-199, or 200-255, respectively. Using vitamins does the same.
-Going to the haircut brothers gives anywhere from +1 to +10 based on the Pokemon's reaction, whether it's the older brother or the younger brother, and depending on the Pokemon's current happiness (check the guide for the specifics).
-Fainting subtracts 1 happiness.