How to use macOS to create a Windows 11 USB installer flash drive

The Windows 11 ISO file, which can be downloaded from Microsoft, contains a install.wim file that is greater than 4 GiB in size. This prevents creating a USB flash drive installer by simply copying the files from the mounted Windows 11 ISO file to a FAT32 formatted USB flash drive.

If you have a machine running Windows, this is not a problem because you can download and run the mediacreationtool.exe file, which can create either a USB flash drive installer or Windows 11 ISO file. In this case, an install.esd file is substituted for the install.wim file. This install.esd file is less that 4 GiB in size and therefore will fit a FAT32 formatted volume.

However, I am use macOS which cannot execute the mediacreationtool.exe file. I am looking for a solution that can be used to create an USB Windows 11 flash drive installer. I would prefer a solution that does not involve using third party tools.