For an automatic:
1. Come to a stop with your foot on the brake pedal and put the car in Park.
2. Set Parking Brake
3. Remove your foot from the brake pedal.
Do this whether you are on a slope or not because it's 1) safer and 2) easier on your mechanical parts and 3) a good habit to be in.