There's a bug with RPi 4's where the audio devices are coming up in somewhat random order after a reboot. Hopefully, this is fixed now, but after an upgrade or reboot if the sound disappears just follow these steps:
Run the alsa mixer, press [F6] to list the sounds cards and note the number of the USB AUDIO entry. Hopefully, it's set to 2 now permanently.
$ alsamixer
Edit the following sound file, replacing the XX's with the number from the previous step.
$ nano ~/.asoundrc
It should look like this:
pcm.!default {
type plug
slave {
pcm "hw:XX,0"
}
}
ctl.!default {
type hw
card XX
}
Next, edit this alsa config file.
$ sudo nano /usr/share/alsa/alsa.conf
Look for the following two lines around the middle of the file:
defaults.ctl.card 1
defaults.pcm.card 1
Change them to the same number as the previous step:
defaults.ctl.card XX
defaults.pcm.card XX
Save all your changes and reboot your RPi. When it comes back up, run the alsa mixer again. The USB AUDIO should be the default now instead of Headphones. As long as that shows as the default, the sound will now work.