This is usually a driver issue. Ensure you have enabled USB Debugging in your phone's Developer Options.
Sometimes, your PC recognizes your phone in ADB mode but fails in Fastboot mode (showing a yellow warning in Device Manager). Download the Google USB Driver . adb fastboot drivers windows 10
How to Install ADB and Fastboot Drivers on Windows 10: A Complete Guide This is usually a driver issue
: Open Command Prompt in the folder where ADB is installed (or platform-tools) and run: your device’s OEM
Outdated drivers cause intermittent disconnections and failed commands. Update your ADB Fastboot drivers when:
Only install drivers from Google, your device’s OEM, or trusted developers (Koush, XDA). Avoid shady “driver updater” tools.