If you build on an Apple Silicon Mac and run on an Intel server, or the other way round, a single --platform list makes an image that works on both.
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t registry.example.com/app:1.0 \
--push .
Buildx builds the Dockerfile once per platform and pushes one tag that points to both. A docker pull on either machine then gets the right variant on its own. You can check the result with docker buildx imagetools inspect.
Building the other platform runs under QEMU emulation, which Docker Desktop has built in. On a Linux host you install the binfmt handlers first. Emulated steps are slow, so a heavy compile can take many times longer. For Go and Rust, cross compiling in the Dockerfile with the BUILDPLATFORM and TARGETARCH build arguments is much faster.
The default image store keeps only one platform per tag locally, which is why the example pushes straight to a registry. With the containerd image store, which Docker Desktop and newer Engine installs use, you can also --load a multi-platform image. I would test both variants once on real hardware anyway, because an image that builds is not always an image that runs.
Further reading: Multi-platform builds