For users who require Windows XP for specialized niche applications or retro-gaming, the safest route is utilizing a virtual machine (like VirtualBox ) rather than installing it on a physical, internet-connected computer. This allows users to experience the "classic" feel without exposing their network to the high-level security risks associated with the unsupported OS.
Windows XP is essentially defenseless against modern malware, viruses, and ransomware due to a lack of security patches for nearly twelve years. windows-xp-free-download-updated
(I strongly recommend an alternative).