Look in the Finder or iTunes
On a Mac with macOS Catalina or later, look for your device in the sidebar of any window in the Finder.*
On a Mac with an earlier version of macOS, look for your device in iTunes.
On a Windows PC with iTunes, look for your device in iTunes.
Update the software on all devices
Connect your device directly to your computer
Make sure that your device is unlocked and showing its Home Screen, then use a USB cable to connect it directly to a USB port on your computer. Don't connect to a USB hub or other device.
If that doesn't help, disconnect your device and all other USB devices and accessories from your computer. Then reconnect only your device.
Trust your computer, if asked
If you see a “Trust this Computer?” alert on your device when you plug your device into your computer, tap Trust.
Try a different port, cable, or computer
The issue could be related to your computer, its USB port, or the USB cable connecting it to your device. If possible, try a different computer, USB port, or USB cable. Also check for any debris in the charging port on the bottom of your iPhone or iPad.
If your computer still doesn't recognize your iPhone or iPad, contact Apple Support.
* This feature depends on a settting: From the menu bar in the Finder, choose Finder > Settings (or Preferences). Click Sidebar at the top of the settings window, then make sure that “CDs, DVDs and iOS Devices” is selected. If you don't see a sidebar in Finder windows, choose View > Show Sidebar from the menu bar, or press Control-Command-S.