Hi Lily,
That message means the OneDrive app is not reaching the cloud at sign-in, even if your internet works. The quickest fix on a Mac is a full OneDrive app reset, which refreshes its sign-in and connection without touching your files.
Quit OneDrive first.
Click the OneDrive cloud in the menu bar, open Preferences, choose Pause, then Quit OneDrive. In Finder open Applications, Control-click OneDrive, choose Show Package Contents, open Contents > Resources, double-click ResetOneDriveApp.command (or ResetOneDriveAppStandalone.command if you see that one), then open OneDrive again from Applications and sign in.
If you are asked where to keep your OneDrive folder, pick the same location you used before so it does not re-download unchanged files. If your OneDrive app is older and does not show the reset script, drag it to
Trashand install the current OneDrive for Mac, then try the reset steps again.
Please try that exactly as written and tell me what happens on sign-in. If it still throws 0x8004de40, I will walk you through the next step.