This is a tutorial on how to build linux and test it using qemu on a M series Mac.
You will need brew, git ,docker, qemu and a Mac with a M series chip (M1, M2, M3 ...)
Install brew from https://brew.sh/ and then install qemu and docker using brew: