You can get a copy of the latest macOS version from Apple download portal or App Store here. The first step is to get the DMG disk image file for the version of macOS that you want. Part 1: Download macOS or Mac OS X DMG File All the steps except the last one are done on a Windows 10 machine.
This article shows you how to download a macOS DMG file, format a USB drive using a GUID Partition Table, burn the DMG to the drive and boot your Mac from the USB. But how do you create such a disk if all you're left with is a Windows 10 computer? Fortunately, there's a great tool that you can use for free to create bootable macOS media on a USB drive in a Windows 10 environment.
If your Mac suddenly refuses to boot up properly, you might need a bootable macOS USB installer to make repairs.