Access iPhone through emulation
You can use VoiceOver to control the device from a USB keyboard. You can usually use a keyboard to enter the passcode, but you also need to press Trust from a keyboard, which you can't do while connected to a computer that is not already trusted. In essence, either


enter the passcode with a USB keyboard and connect the device to a trusted computer, or
use VoiceOver to control the device from a USB keyboard to perform a backup to iCloud, steps for which are provided at https://deciphertools.com/blog/iphone-passcode-broken-screen/.