School and training really do provide you the opportunities to develop that kind of thinking. As a student the key is to work hard and be engaged in the clinical care of patients and striving to understand the decision making involved. You can also go above and beyond what most students do in terms of reading.
Start making it a habit to read something about every single patient or disease you personally see. It’s easy to let these opportunities pass you by, but I’ve learned a ton from just reading about what I see. Most students do the bare minimum and focus more on shelf prep. If you have the bandwidth to do both, reading on what you see goes a long way toward helping you remember things.
Another piece of advice I got early that has helped immensely: read proportionally to the incidence of what you see. It’s tempting to read about rare things and that’s certainly part of the job, but more important is knowing common things well. In my field of ent that means things like chronic sinusitis, tonsilitis, hearing loss, skin and mucosal squamous cell carcinoma, etc. In IM it probably means diabetes, hypertension, coronary artery disease, lung cancer, etc. If you know the most common things extremely well, you have more time and bandwidth to handle the rare things.
The other key thing I’ve found is that you can usually figure something out if you just take the time to investigate it. As you go along, you’ll develop a sense of what normal looks like as well as the typical course of the diseases you treat. When something doesn’t seem to fit, don’t let it go until you’ve satisfied your intuition. That’s usually what predicates my unusual diagnoses- a sense that something isn’t right and continuing to investigate until I have an answer.
Which brings us back to now: take every opportunity you have to spend time with patients and start developing that sense of how things go. It takes years - you won’t get there as a student - but if you work at it you will start to in residency. I’m a new attending and still figuring this out, but the keys are time with patients, reading, and paying attention.