The optimal Paladin rotation is known as "969" because you alternate one of your three spells that can be cast every 9 seconds with ones that can be cast every 6 on an endless loop. In order for this to work, you cannot use Glyph of Consecration and you must have at least 1/2 Improved Judgements from the Retribution tree (2/2 doesn't add a huge benefit so most stick with 1/2).
The order in which you cast the spells doesn't really matter as they rotate and all get equal uptime so for example it could go:
Holy Shield (9) > Hammer of the Righteous (6) > Judgement (9) > Shield of Righteousness (6) > Consecration (9) > Hammer of the Righteous (6) > Holy Shield (9) > Shield of Righteousness (6) > Judgement (9) > Hammer of the Righteous (6) > Consecration (9) > Shield of Righteousness (6)
Which brings us back to Holy Shield again. What you'll find is that after you've used everything in the correct order the first time you'll be "locked in" to 969 - you'll press whichever is off cooldown and only one will be off cooldown at any given time. From there it's cake
If you're still having threat trouble once you've got your rotation learned by heart, try using the Retribution Libram for Emblems of Triumph (200 Strength, near to 100% uptime), using Avenging Wrath (wings) on every cooldown (especially before the pull) or casting Hand of Salvation on DPS that are creeping up high to you on threat.