Go to New Bark Town to receive a Master Ball from Professor Elm! This powerful pokéball has a 100% chance of capturing whatever pokémon you use it on, and it is very rare. You are unlikely to get another one (unless you manage to match the Lucky Chance number in the Goldenrod Radio Tower). So don't use it unless you absolutely have to!!
Ecruteak
With the Master Ball in tow, go to Ecruteak City, to the Dance Theater. Silver will be rude to you, but then you can go in. You will have to fight all five Kimono Girls. They are very tough!
Once you defeat them, you get the Clear Bell if you are playing HeartGold, or the Tidal Bell if you are playing SoulSilver. In HeartGold, your next destination is the Bell Tower. In SoulSilver, it's the Whirl Islands.
If you are playing HeartGold, stock up on Dusk Balls. Get tons of them. If you are playing SoulSilver, get tons of Heavy Balls instead. Also, get Timer Balls.
After going through the Bell Tower or Whirl Islands, you will find the Kimono Girls. They will summon Ho-oh in HeartGold or Lugia in SoulSilver.
Catching Ho-oh
Because the game considers Bell Tower to be a cave, Dusk Balls give you a 3.5x multiplier. Bring Ho-oh's HP down as far as possible without KOing it (use False Swipe if you have it) and then make it go to sleep, or freeze it. Then start throwing Dusk Balls at it. Keep track in your mind of how many turns the battle has gone on for, because if it goes on for 30 and you still haven't caught Ho-oh, you should switch to using Timer Balls, because they have the slightly better 4x modifier.
Catching Lugia
Lugia is a heavy pokémon, so the Heavy Ball is your best bet. Bring Lugia's HP down as far as possible without KOing it (use False Swipe if you have it), and then make it go to sleep, or freeze it. Then start throwing heavy balls at it. If you run out, and the battle has gone on for at least 30 turns, use Timer Balls. Or you can use Fast Balls, which will have the same multiplier as the Timer Ball after 30 turns.
If you don't catch the legendary pokémon, don't despair! It will reappear after you defeat the Elite Four and the Champion. For this reason, it is strongly recommended NOT to use your Master Ball here.