What I tend to do is pick a few "core" items for each champion, items that work on them very well no matter what happens, then supplement the rest of the build with items that work well against your opponents or allow you to perform better in your established role in the game, which changes even if you pick the same champion over and over.
For example, Azir loves CDR and attack speed, so getting an early stinger on him as a core item is a good idea because it gives him a TON of lane pressure which stops your mid lane from roaming or makes them pay for it with a tower. However, he is pretty squishy and dependent on his soldiers for damage, so if you're against somebody who just wants to sit in lane and try to kill you, then rushing a rod of ages as a good defensive/offensive mix of stats might be what you want to do. You could have either catalyst or stinger as your first buy because both aren't really expensive and provide good benefits, then from there you can go either RoA or Nashor's depending on what your opponent is trying to do.
Maybe you're in a lane Azir can dominate easily instead though, which means you might want to just rush the stinger into nashor's and grab early Ionian boots for max offensive power before getting any RoA components so that you can apply more lane pressure and keep the enemy away from the CS or push their CS into their tower so they lose it.
Doing either of those is pretty safe IMO because later on in the game if you somehow end up behind, gods forbid, you can either finish your RoA first for the extra safe laning/defending and then move on to Nashor's Tooth if you regain a lead, or go for more defensive options on top of your RoA while just sitting on your Stinger as your source of damage.
Azir is also amazing at split pushing, so you could just go straight for Nashor's even if you're behind and do that instead if you're careful enough. Both choices are pretty safe picks if you play them right, it's all about being adaptable to the situation.
Before late game team fights roll around you'll also want to pick up some defenses to stay on even ground with the enemy, and which type of armor you get should be dictated according to who on the enemy team is the biggest threat at the time. Is their ADC ahead in kills but their AP mid lane isn't much of a threat? then consider getting armor before MR.
I find that generally armor is usually more important than MR anyway because magic damage tends to be in bursts that can easily be avoided unless a huge fight breaks out, at least in my experience, but the physical damage from an ADC is sustained and can hurt like hell if you have no armor to defend yourself with. However, if you're against somebody like Akali and she has a focus on killing you first, then you'll definitely want to get the MR first.
Other than that I feel like it's all in how you play your champion. Even if you got the "wrong" items for your situation, just playing the champ the right way for the situation you're in can sometimes have the same impact on the game as if you had bought the "right" ones. Knowing your enemy and its patterns can really help you out as well. Are they going to take every dragon because they're ahead and you can't stop them? then consider taking yourself top lane, even if you don't have your splitpush items, and try to get a towers or maybe even an inhib. Trading objectives like that is key to winning.
This does not mean that you should just say "Fuck it" and rush the Garen who has a completed black cleaver and giants belt while you have nothing but a Doran's blade and a pair of boots though, know your limits and play within them.
Another thing you could try is buying what I call "Anti-Core" items against champs. You might not think to buy MR/Tenacity boots in mid lane because you really need that Mpen for your damage, but if you're against a Veigar and get those you can actually walk out of his stun before his W lands. Little tricks like this are situational as hell, but can save your life, and maybe even the game, if you're in an extremely tight spot.