This article explains how to create a bootable installer for OS X or macOS using a USB flash drive.
HOW TO MAKE A BOOTABLE MAC OS X USB DRIVE WITH WINDOWS 10 — 2023 NEW METHODS
First, you’ll need the OS X or macOS installer on your Mac. Ideally, you’ll download the installer, but not use it. When you download and use the OS X or macOS installer, the installer will remove itself as part of the installation process. If you’ve already installed OS X or macOS, re-download the installer.
Once downloaded, the installer will be located in your Applications folder. It will be called “Install OS X [your version]” or “Install macOS [your version].”
You will also need a USB drive. Make sure it has at least 12GB of available storage and is formatted as Mac OS Extended.