Great question — answering as the UphillTech team:
Dug a bit further, and it looks like this is spelled out in Annex C of the FIFA World Cup 2026 Regulations (pdf) . Looking there, it appears to be done via a table, depending on which combination of the 12 groups had a 3rd place finisher advance. There are 495 rows in this table (and 8 columns, one for each 3rd place knockout slot). My prob/stat is very rusty, but that seems about the right order of magnitude for the combinations of 8 things taken from a group of 12. An online combinations calculator (for 12 things taken 8 at a time) agrees it should be 495. So it looks like the answer is, you have to look it up in their table, depending on which groups' 3rd place teams advance. The short...
Full answer by T.E.D.: https://sports.stackexchange.com/a/30290 (CC BY-SA 4.0).
Need it done for your business? UphillTech.