You’re logged in on the physical console of a server, or on a serial or IPMI console, and halfway through a command the kernel prints a USB or network message right across your screen. dmesg can turn that down.
sudo dmesg -n 4
-n (long form --console-level) sets which kernel messages still reach the console. Only messages more important than the level you give get printed, so 4 (warning) lets emergency, alert, critical and error messages through and keeps warnings and everything below off your screen. The man page’s own example is -n 1, which leaves only panic messages.
Nothing gets lost. The messages still go into the kernel log, so dmesg and journalctl -k show them like before. You can see the current value as the first number in:
cat /proc/sys/kernel/printk
If you want the console completely quiet for a moment, dmesg -D switches the printing off and dmesg -E turns it back on.
The caveat: it’s gone after a reboot. To keep it, add loglevel=4 to the kernel command line, or set kernel.printk in a file under /etc/sysctl.d/. And I wouldn’t go all the way down on a machine you troubleshoot from its console, because a crash message is exactly what you want to see there.
Further reading: dmesg(1) man page, Linux kernel docs: /proc/sys/kernel/printk