How to make systemd units depend on specific hardware

Sometimes you need a systemd service to wait for a specific hardware device to be available before starting. For instance, when starting an X11 session as a service, you want to ensure the GPU is ready.