Apart from sleep settings, your WD external hard drive may have other issues causing it to constantly disconnect, such as damaged USB cable, insufficient power supply, software bugs, third-party software intervention, disk corruption, etc.
Since your WD external disk is new, consider returning it or contacting support for a new one.
If you want to troubleshoot the issue, start by checking the connections. Try unplugging the drive after properly ejecting it and then replugging it. You can also switch to a different USB port, use a powered hub, or connect it directly to your Mac. A reboot may also help.
If you have installed a VPN or other third-party security software like antivirus, try disabling it or uninstalling it.
Suppose your WD external hard drive continues to disconnect, then you might want to reformat it after backing up the essential files.
If the auto-disconnecting issue has rendered your disk inaccessible, you can use iBoysoft Data Recovery for Mac to retrieve your files. It can restore photos, videos, audio, documents, and other types of data from corrupted or inaccessible external disks on Mac.
Click the button below to scan your drive and preview found files for free!
For more solutions, check: Fix External Hard Drive Keeps Disconnecting on Mac