With uuidgen
macOS includes uuidgen:
uuidgen
It prints a random version 4 UUID in uppercase, like 3F2504E0-4F89-41D3-9A0C-0305E82C3301.
Lowercase, straight to the clipboard
uuidgen | tr '[:upper:]' '[:lower:]' | pbcopy
Many databases and APIs use lowercase, so this is the version most developers want.
Several at once
for i in {1..5}; do uuidgen; done
From the notch
NotchMind, which I make, has UUID v4 on its Developer Tools page. Open the notch, pick it, press the button, then Copy result. No Terminal needed. See developer tools in the notch.
Is it unique?
A version 4 UUID has 122 random bits. You can treat a newly generated one as unique for any practical purpose.
NotchMind