I asked chatGPT and got this suggestion:
sudo ifconfig en0 ether XX:XX:XX:XX:XX:XX
Note: Replace "en0" with the name of your WiFi interface. You can find the name by typing "ifconfig" in the Terminal window and looking for the name next to "en" or "en0".
Replace "XX:XX:XX:XX:XX:XX" with the MAC address you want to use. You can generate a random MAC address or use a specific one.
Press Enter and type your password when prompted.
Verify that the new MAC address has been applied by typing "ifconfig" in the Terminal window and looking for the new MAC address under the "ether" field.