I'm asking this out of curiosity rather than practicality: If I install TOR on my Windows machine, how do I use it securely without exposing my identity? Also, what if my machine has already contacted other websites and servers prior to the usage of TOR? Would that have any effect on my anonymity?
If I install TOR on my Windows machine, how do I use it securely without exposing my identity?
These are very broad questions and impossible to answer specifically for you.
Are you worried about Windows/Microsoft doing something bad? Well you need to convince yourself that they can't do something bad or they won't do something about to you. If you can't, then maybe you shouldn't be using Windows.
Are you worried about network-level adversaries correlating your traffic as it enters the Tor network with when it exits the Tor network? You'll have that issue on every OS.
Are you worried that the websites you visit will serve you an exploit and deanonymize you? Tor Browser already takes extensive steps to limit how well they can fingerprint you. When really good fingerprinting vectors have been found, they have been patched quickly. Historically, when big adversaries have an exploit and they use it to deanonymize some Tor Browser users, they used it on high profile people or people doing Really Bad Things. This is most likely because these exploits are rare (thus valuable) and using them to deanonymize all the boring everyday Tor Browser users would be wasteful since it would likely get detected and fixed.
So, in short, I don't think you or any other average Joe out there needs to worry when using Tor Browser on Windows. Most likely, the biggest threat to you will be yourself and your own behavior. https://www.torproject.org/download/download-easy.html#warning
Also, what if my machine has already contacted other websites and servers prior to the usage of TOR? Would that have any effect on my anonymity?
Probably not? It's impossible to say with the amount of detail you've given. What websites? Did you log in to them? Will you visit them with Tor Browser too? Will you log in with Tor Browser? Do you care if the website knows it is you but doesn't know where you currently are?
So, again, probably not anything to worry about here.
If you visit a website through Tor, they don't know who you are unless you log in or otherwise reveal personal information (for instance saying your name or email in chat)