I have currently installed 2004 version of Windows 10, if i update it to 20H2 version, will i get rid of any trojans or rootkits on my computer? Where are those typically get installed? I don't want to do format on my disk.
Updating Windows does not affect any personal files, only system files. As any malicious software would not be a 'system file', there's a reasonable likelihood it would remain untouched.
See How can I remove malicious spyware, malware, adware, viruses, trojans or rootkits from my PC? for further information.