To answer your question, I'm going to explain how the catch chance formula works (the chance you catch a Pokemon when you throw any poke ball).
There are three different factors that affect your chances of catching a Pokemon. These factors are:
-- the wild Pokemon's HP
-- the type of poke ball you use
-- whether or not the wild Pokemon is affected by a status condition (poison, paralysis, etc.)
You already know to deplete a Pokemon's hp as much as possible without fainting it, so I'll pass over that for now.
Anyway, to calculate the odds of catching a legendary Pokemon after you have reduced its hp to a "little sliver of red" can be found with this formula:
Catch chance = (catch rate×bonus (poke ball) ×bonus (status condition)) ÷ 255
I did not include the HP and Shake Check formulas here because this formula assumes that the wild legendaries in question have their hp weakened down to red. This formula is only true for Pokemon with depleted hp. If anyone thinks that I need to include the HP/Shake Check formulas, leave a comment and I will edit 'em in.
Moving on, different poke balls apply different bonus multipliers to the formula when you use them. A pokeball, for example, has a bonus of 1x, meaning it multiplies the numerator of the fraction above by 1. Great balls have a bonus of 1.5x, so using one adds a 1.5 value to the multplication. Ultra balls have a bonus of 2x.
It's the same thing with status conditions. The five status conditions are paralyzed, poisoned, burned, asleep, and frozen. Their bonus multipliers are 2.5x for frozen and asleep and 1.5x for paralyzed, poisoned, and burned.
Confusing? Don't worry, here is an example.
Here is the calculation for the odds of catching Calyrex, Regirock, Regice, Registeel, Regieleki, Regidrago, Galarian Articuno, Galarian Zapdos, Galarian Moltres, Virizion, Terrakion, and Cobalion using an Ultra ball, no status conditions:
Catch chance = (catch rate × ultra ball bonus × status condition bonus) ÷ 255
= (3 × 2 ×1) ÷ 255
= 6 ÷ 255
= 0.0235... = 2.4% chance to catch
So you have a 2.4% chance to catch all of these legendaries with no status conditions each time you throw an Ultra ball! That's 1 out of 42 ultra balls successfully catching! Not very promising...
Let's apply a status condition. For catching Pokemon, paralysis and asleep usually work best. This calculation applies asleep:
Catch chance = (catch rate × ultra ball bonus × asleep bonus) ÷ 255
= (3 × 2 × 2.5) ÷ 255
= 15 ÷ 255
= 0.0666... = 6.7% chance to catch
This one applies paralysis:
Catch chance = (catch rate × ultra ball bonus × paralysis bonus) ÷ 255
= (3 × 2 × 1.5) ÷ 255
= 9 ÷ 255
= 0.0352... = 3.5% chance to catch
Though these odds are better, 3.5% and 6.7% catch rates per ultra ball are still not the most favorable. That's 1 of 15 and 1 of 29 ultra balls catching successively, respectively.
Luckily, Game Freak invented Timer balls.
Timer balls, as you may know, have a higher chance of catching the more turns that pass in a battle. Basically, after ten turns, timer balls have a bonus multiplier of 4x. That's twice the effectiveness of an ultra ball!
Catch chance = (catch rate × timer ball bonus after ten turns × paralysis bonus) ÷ 255
= (3 × 4 × 1.5) ÷ 255
= 18 ÷ 255
= 0.0705... = 7.1% chance to catch per ball, or 1 out of 14 timer balls
Catch chance = (catch rate × timer ball bonus after ten turns × asleep bonus) ÷ 255
= (3 × 4 × 2.5) ÷ 255
= 30 ÷ 255
= 0.1176... = 11.8% chance to catch per ball, or 1 out of 9 timer balls
So, for the best possible odds, you should use timer balls and have a defensive Pokemon with Spore or Sleep Powder. Or, if you find asleep too unreliable, use a Pokemon with Thunder Wave to paralyze.
Also, the catch chances above are not exact but instead very close estimates.
Hope this answers your question!