Hi! Welcome to the Samsung Members community!
Make sure the port is free from dirt, dust, and debris. *this is the most common reason
Check the cable—does it work on other devices?
Check if the phone is up to date.
Clear USB cache:
1. From Settings, navigate to Apps, then tap the filter and sort icon. 2. Move the switch to the right to enable Show system apps, then tap OK. 3. Scroll to USB Settings and tap Storage. 4. Tap Clear cache located in the bottom right-hand corner of the screen to clear your USB cache.