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 PC with iTunes for Windows, look for your device in iTunes.
Update the software on all devices
Connect your device directly to your computer
Make sure your device is unlocked and displaying its Home Screen, then use a USB cable to connect it directly to your computer. Don't connect to a USB hub, display 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 it into your computer, tap Trust.
Allow the accessory to connect
When you connect your device to a Mac laptop with Apple silicon, your Mac may ask whether you want to allow the accessory to connect. If so, allow it to connect.
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 recognise your iPhone or iPad, contact Apple Support.
* This feature depends on a setting: From the menu bar in the Finder, choose Finder > Settings (or Preferences). Click Sidebar at the top of the settings window, then make sure "CDs, DVDs and iOS Devices" is selected. If you can't see a sidebar in Finder windows, choose View > Show Sidebar from the menu bar or press Control-Command-S.