Begin with the USB flashdrive unplugged from your computer.
Download the Ubuntu 16.04 64-bit desktop image from http://releases.ubuntu.com/16.04/
curl -O http://releases.ubuntu.com/16.04/ubuntu-16.04.6-desktop-amd64.iso
Convert the .iso file to .img with hdiutil
hdiutil convert -format UDRW -o ubuntu-16.04.6-desktop-amd64.img ubuntu-16.04.6-desktop-amd64.iso
Remove the .dmg file extension that macOS adds automatically (annoying!)
mv ubuntu-16.04.6-desktop-amd64.img.dmg ubuntu-16.04.6-desktop-amd64.img
List the current devices connected to your machine.
diskutil list
Now plug in your USB flashdrive and list the current devices again.
diskutil list
Identify the new device node assigned to your USB flashdrive. In my case, this is /dev/disk2.
Unmount the disk.
diskutil unmountDisk /dev/disk2
Write the image file onto the USB. This step may take several minutes.
sudo dd if=ubuntu-16.04.6-desktop-amd64.img of=/dev/rdisk2 bs=1m
When this is complete, you may get a warning that the disk isn't readable by your machine. That's fine, hit 'Ignore'.
Finally, eject the USB flashdrive.
diskutil eject /dev/disk2
Remove your USB flashdrive from the machine and you're good to go!