Hello, I’m Virginia, I have 20 years of expertise in fixing my own & friends’ PC problems.
Sorry to hear you’re experiencing problems. May I ask which Windows 10 build are you running - 2004, 20H2, 21H1 or 21H2?
Have you tried new batteries?
Have you updated the firmware?
Are you using the unifying receiver & software?
Is Logitech Options installed?
https://support.logi.com/hc/articles/360024701174--Downloads-Wireless-Mouse-M510
Note: This is a non-Microsoft website. The page appears to be providing accurate, safe information. Watch out for ads on the site that may advertise products frequently classified as a PUP (Potentially Unwanted Products).
Please do not download any repair tool which may be offered by this site other than the ones I mention/recommend.
Thoroughly research any product which is mentioned here before you decide to download and install it.