I start with the old connector and Google as needed....
All the connectors have a part number or a partial part number molded into them. In some cases you literally need a magnifying glass to read the info. If they have what looks like a full part number, I use that in the Mouser search and the right connector will pop up 50% of the time. Even if it's a partial part number you can narrow the results using the pin count, wire size, etc.
If the above fails I drop the number and sensor name into Google. So my search might be "2019 Corvette LT1 MAF connector part number #######" Sometimes it can take creative searching and/or picture sleuthing to finally find the right manufacturer and part number. Often what you find is that the "real" part number has dashes and/or spaces which throws off the Mouser search. Probably the biggest challenge is who the actual manufacturer is since many will have connectors that look almost identical but it's a classic case of "close" only works in horseshoes and hand grenades. Attention to detail really comes into play.
These days I can find just about anything in 20-30 minutes but the initial searches were hours
Some examples...
Coil Connector R1.jpg
Connector part number R1.jpg