There are a couple of reported configurations where you might find that your machine does not recognise your BBC micro:bit device.
Firstly, make sure check you have the correct USB data lead.
Secondly, ensure that any Antivirus software you are using excludes the microbit drive from being scanned automatically. This can prevent it from mounting as a drive.
Windows 10
If the micro:bit is not recognised or it is just listed as a FAT drive and you are unable to flash code to it, you should check on another device that you are running the latest firmware.
If you are using the Windows App, please refer to the MakeCode Editor help for more information.
If you are using WebUSB, ensure that you do not have a legacy MBED driver installed on your machine from a previous version of Windows
OS X
If the micro:bit is not recognised, please update your machine to the latest stable OS if you are able. If you are still experiencing issues, try restarting the maachine ensuring that nothing else is trying to use the USB port, by only opening the applications you need to work with micro:bit. You can do this on startup by unticking Reopen windows when logging back in.
Thanks to @ForrisHilier, Ari Keränen and others for identifying the respective resolutions