How does rule 3. Advantage and Disadvantage from Ten Rules to Remeber function?

Ten Rules to Remember in Tasha’s Cauldron of Everything reminds us via rule 3. Advantage and Disadvantage:

Even if more than one factor gives you advantage or disadvantage on a roll, you have it only once, and if you have advantage and disadvantage on the same roll, they cancel each other.

Now that leads to the natural question of in what order these things happen. When you gain "advantage" from multiple sources and "disadvantage" from one source, do you only gain "advantage" once that then is cancelled out by "disadvantage" thus resulting in neither or do you get "advantage" once from one source, that then is cancelled out by "disadvantage" from one other source thus allowing for "advantage" from another source to take place – as there are neither "advantage" nor "disadvantage", at that point, in the chain?