You should check the USB cable and USB port on your phone if you’re having trouble connecting to an external device. You can also try using a new cable instead.
Samsung Galaxy TAB Tablet 7 8.9 10.1 USB Data Lead Cable Charger
Charger Cord Micro USB Compatible Samsung Galaxy Tab A 7.0” 8.0”(2015) 9.7” 10.1”, Tab E 8.0” 9.6”, Tab S2 8.0” 9.7”(2015), Tab 3/4 7.0” 8.0” 10.1”, Tab Pro 8.4” 10.1”, Tablet Charging Cable-2ps : Electronics
Fix Samsung Usb Connector (Connected, Disconnected), Screen not turn off
Use a USB Type-C cable or adapter with a phone or tablet
PKPOWER 3.3ft White Micro USB Charger Sync Data Cable for 8 Samsung CE0168 Galaxy Tab Wi-Fi Tablet PC PSU
How to Fix a Loose Charging Port USB-C in Samsung Galaxy or Lighting Port in iPhone
USB Cable For Samsung Galaxy Tab, Cables, Charge and utility
Move photos, videos, or music from your Galaxy phone or tablet
USB Data Charger Cable for Samsung Galaxy Tab 2 10.1 inch SGH GT Tablet Note 7
Connecting to an Android phone or tablet with a USB cable