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?
You are correct there are some concerns with tor on Windows as it is the most popular OS. The three things I would recommend the most are: keep your tor browser up to date (when you start tor browser it will tell you there is an update available, go to the options to install, always do this), don't change the size of tor browser windows as monitor size is a fingerprint, and DO NOT open files downloaded over tor while connected to the internet as they could possibly have some malicious code in them to send out your real ip address.– theoneandonnlyJul 30, 2018 at 4:48
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 I visit a website with TOR that I've logged into the past, will they be able to detect it's me? I've heard that it's better to download TOR on a brand new machine than it is to download it to a machine that's already been connected to the Internet before.– ssharmaDec 2, 2017 at 23:00
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)