If your computer doesn't recognize your phone, follow these steps.
Set the USB connection to File transfer or PTP.
The USB connection defaults to Charging this device via USB. You must change this setting in order to transfer files.
Try a different USB cable.
Many third-party USB cables can only charge and don't have the internal wiring to transfer data. Use the original cable that came with your phone or buy a USB data cable.
If your phone detects moisture, it will disable the USB port for safety. In this case, unplug the phone immediately. Gently shake it, with the USB port facing down, to remove excess liquid. Let it air dry completely before trying again.
Turn your phone off and then on again.
Press & hold the Power + Volume up buttons simultaneously, then tap Restart.