After lots of comments above… and the declaration that I am in no way a purist in this. Close enough is close enough. I don't get into the argument that modelling amps just aren't the 'real thing'.
Also, I very rarely play covers, so for me this is usually just an intellectual exercise, or a point to go from if I want a 'sound like xyz' on whatever record. This makes 'perfection' less important, it's the feel of what that sound can do.
Of course, there is always the consideration that the guitarist has at least as much effect on the sound as the gear they use - but that's just a bridge too far for this answer, so let's look at the gear. You do have to acknowledge, though, that you have to 'play in the style of', if you're going to sound like.
I think one approach to this is to have an awareness of what the particular artist may have used in the first place. These days, that kind of info is not impossible to pick up on the interwebz.
After that, it becomes familiarity with which guitars sound like what, what an amp will do to affect a sound generically, how effects pedals influence this.
I have a Variax & Amp Farm. This gives me ~40 different guitars & ~15 different amps with multifarious pedals & effects to test out for any investigation of this sort. You learn over time what gives at least some of these their unique characteristic. Flipping between basic guitar types can sometimes quickly tell you… not a Fender, not a solid Gibson, hmm… might have been a Rikki. This is an imperfect solution, but after a while, you can generally set off in the right direction just with a practised ear.
You can divide things up by 'era' sometimes, to make the choices perhaps slightly easier. This, of course, gets simpler the further back you go. If you're trying to figure out a Beatles setup, then you can immediately discard any amp or guitar not available at the time. No Dumbles, H&Ks or JCM800s. No PRS or 7-string behemoths tuned down to D.
Some research & some guess work… Vox was the amp of choice early, Fenders later. John & George went from 'jazz-era' semi-acoustics to solids, Gibson or newer semis, Rickenbacker. They would swap & change, but the choice is still fairly limited. Watch "Get Back" if you want more detail.
Knowing just this can push you in the right direction.
I watched McCartney at Glastonbury this year, which gave me the impetus to find the guitar sound from "Let Me Roll it", which I'd always considered very Lennon-esque. Took about 5 minutes, it wasn't a tough sound to get. From there the sound in Cold Turkey became easier to find. [I didn't keep the settings, so can't look up what I did. It was just 20 mins of fun.]
Knowing 'Hendrix used a Strat & a Marshall' will set you off in one direction - but then you discover he also had a fuzz box; which nails the sonic distinction. No 60s Marshall had a high-gain structure, so it had to be a fuzz box. Precisely which one is far less important.
Sometimes on a very simple setup, the choice of guitar becomes paramount. Wind Cries Mary is in my mind the 'epitome of a Strat'. I use to have a 64 Strat which could do it to perfection. I currently have three newer Strats of various quality & vintage, plus the Variax, none of which can do it justice.
Sometimes you can get really close, then have a revelation - changing the 'mic', or the angle to the speaker cabinet, or moving it further away can make a lot of difference. Of course, in software, this is a couple of clicks to achieve.
Guessing what pedals someone uses can be approached in the same way. Without the info, again it's experience - that sounds like a phaser. I don't know which one, but it's a start. This sounds like it's got a lot of room on it - did they do it with two mics or is it just 'reverb' added later?
I honestly don't know how you would do this without access to at least modelling versions of the gear you are looking for. You cannot make a Strat through a 60's Marshall sound like a Les Paul through a Mesa Boogie, or vice versa.
If you get into amp modelling, then you get a slew of presets with them - usually with some hints as to what they can be used to emulate. Spending some time going through these to see what they're made of can be a great help in familiarising yourself with what each component adds to the overall sound.
One additional point - I'd hazard a guess that 90+% of any sound isn't achieved in post. It's done at source, as that's what the guitarist has to play against at the time of recording.