Hi, and welcome to the UK community
Try clearing the USB cache
Settings>Apps. Tap sort icon (1st screenshot). Toggle on Show system apps, tap done (2nd screenshot). Scroll down to USBSettings and tap on it (3rd screenshot). Tap Storage and tap Clear Data and Clear Cache (4th screenshot).
Failing that try a hard reset
With the device powered up, Hold the Volume down button and Power button simultaneously for 10 seconds. The screen will go off. Continue to hold buttons until the device vibrates and the Samsung logo appears. Release buttons. Device will reboot. Once done, please check if the issue is resolved.
Try Safe Mode
To get to Safe Mode - Long press Power button, long press Power off icon, tap Safe mode icon. (When booted into Safe mode you may need to turn off flight mode as it sometimes enables itself). Monitor your devices behaviour. If the issue is fixed then you know it's one of your 3rd party apps or customisations that were the culprit. It's then up to you to determine which one by a process of elimination.
Try wiping cache partition
Plug into a working PC or laptop or other Samsung device
https://www.samsung.com/uk/support/mobile-devices/how-do-i-clear-the-cache-on-my-device/

