There are five different ways this can go
I will refer collectively to the damage changing effects as "damage movers"
I would argue that both warding bond's damage sharing and the Shield Guardian's damage transfer occur after you actually take the damage.
With warding bond this is more obvious, as it says "each time it takes damage" which would require you to actually take said damage.
The Shield Guardian is more complicated, if they wanted it to transfer the damage before you actually took it, they could have worded the effect "half of any damage the wearer would take..." but instead it is worded as half of the damage you actually take, which, just as with warding bond means you have to take the damage.
This is weird in some scenarios, such as if you have 5 health and take 6 damage, you would be reduced to 0, and then half of the damage you took would transfer to the guardian and you would end up with 2 health, however; you have still taken 5 damage.
I believe this is true because the Guardian says:
half of any damage the wearer takes...
which means that you do still take all of that damage, some of it is just moved after the fact. (A smaller reason is explained at the end as well). Note that this only has an effect when warding bond's damage share occurs right before the Guardian's damage transfer.
With it established that both damage movers occur simultaneously we can use the rules from Xanathar's Guide to Everything on simultaneous events (page 77):
If two or more things happen at the same time on a character or monster’s turn, the person at the game table — whether player or DM — who controls that creature decides the order in which those things happen.
Thus the order in which these are applied can change and so too would the way the damage is moved around and distributed change.
Another important thing, shown in this Q/A on Shield Guardians and this Q/A on warding bond, is that the resistance granted by warding bond will take effect before anything else as both of the damage movers require you to actually take damage, which you have not done until after resistances are applied.
Now I will discuss the different outcomes one at a time: In parentheses after each step is the damage you have taken followed buy the damage the Guardian has taken.
- If the Shield Guardian casts warding bond on you, and it is dealt 20 damage:
This is a straightforward scenario as the amulet cannot do anything, as you are wearing it, not the Guardian, and warding bond cannot do anything, as the caster took the damage, not the target of the spell. (0/20)
Overall, the Guardian will simply take 20 damage.
- If the Shield Guardian casts warding bond on you, and you are dealt 20 damage, and you use warding bond's effect first
Because warding bond's resistance will apply before the damage movers you now take only 10 damage initially. (10/0)
Because warding bond is happening first the Guardian takes the same 10 damage. (10/10)
Then the Guardian's effect happens and half the damage transfers to the Guardian. (5/15)
Overall, you take 5 damage and the Guardian takes 15.
- If the Shield Guardian casts warding bond on you, and you are dealt 20 damage, and you use the Shield Guardian's effect first:
Like above, because of warding bond, you will take only 10 damage initially. (10/0)
The Guardian's effect occurs and half of the damage transfers to the Guardian, but you have actually taken 10 damage, as explained earlier. (10-5/5)
warding bond makes the Guardian takes the same amount of damage you did. (10-5/5+10)
Overall, you will take 5 damage and the Guardian will take 15.
- If you cast warding bond on the Shield Guardian and you are dealt 20 damage:
The Guardian's transfer will trigger, splitting the damage. (10/10)
Then warding bond's resistance will apply. (10/5)
Then you will take the same damage the Guardian did. (10+5/5)
Then, again, the Guardian's transfer will trigger (rounding up). (10+2/5+3)
warding bond's resistance will apply again. (10+2/5+1)
You will take the same damage as the Guardian. (10+2+1/5+1)
The transfer occurs for the final time. (10+2+0/5+1+1)
warding bond reduces the damage yet again. (10+2+0/5+1+0)
Overall, you will take 12 damage and the Guardian will take 6.
The fact that warding bond can apply multiple times is corroborated in this Q/A where multiple instances of resistance can apply if the caster and the target of warding bond both have resistance. This is because it is a new instance of damage each time. (further evidence is shown at the end as well)
- If you cast warding bond on the Shield Guardian and it is dealt 20 damage:
You can simply start at the second line in the above process with the Guardian taking 20 damage, instead of 10.
First warding bond's resistance will apply. (0/10)
Then you will take the same damage the Guardian did. (10/10)
Then the Guardian's transfer will trigger (rounding up). (5/10+5)
warding bond's resistance will apply again. (5/10+2)
You will take the same damage as the Guardian. (5+2/10+2)
The transfer occurs for the final time. (5+1/10+2+1)
warding bond reduces the damage yet again. (5+1/10+2+0)
Overall, you will take 6 damage and the Guardian will take 12.
There is no best option here.
If the Shield Guardian casts warding bond on you the damage either splits 0/20 or 5/15. If you cast warding bond on the Shield Guardian the total damage is lessened but whoever was initially attacked, will take more than just half of the initial damage. If you only used the Shield Guardian and no casting of warding bond then you would get either a flat 10/10 split (if you were attacked) or a 0/20 split if the Guardian were attacked.
Additional explanation of why the Guardian's transfer doesn't lessen the damage you are considered to have taken:
If you take the view that transferring damage does change the amount of damage you have actually taken, scenario 3 would have a different result:
You will take only 10 damage initially. (10/0)
The Guardian's effect occurs and half of the damage transfers to the Guardian. (5/5)
warding bond makes the Guardian takes the same amount of damage you did. (5/5+5)
Overall, you will take 5 damage and the Guardian will take 10.
This makes it strictly better to use the Shield Guardian's effect first, though you could accept this method if you wished.
Additional explanation of why warding bond's resistance can apply multiple times:
If you did not let the resistance apply multiple times, damage would rack up infinitely in scenarios 4/5:
The Guardian's transfer will trigger, splitting the damage. (10/10)
Then warding bond's resistance will apply. (10/5)
Then you will take the same damage the Guardian did. (10+5/5)
Then, again, the Guardian's transfer will trigger (rounding up). (10+2/5+3)
warding bond's resistance will not apply again. (10+2/5+3)
You will take the same damage as the Guardian. (10+2+3/5+3)
The transfer occurs again (rounding up). (10+2+1/5+3+2)
You take the same damage as the Guardian. (10+2+1+2/5+3+2)
The transfer occurs again. (10+2+1+1/5+3+2+1)
You take the same damage as the Guardian. (10+2+1+1+1/5+3+2+1)
The transfer occurs again. (10+2+1+1+0/5+3+2+1+1) = (14/12)
You take the same damage as the Guardian. (10+2+1+1+1/5+3+2+1+1)
The transfer occurs again. (10+2+1+1+0/5+3+2+1+1+1) = (14/13)
This continues infinitely so you take 14 damage and the Guardian is reduced to 0 HP.