Plug in the trackpad using the Lightning cable, or (if not already tried, and if the trackpad is a model that uses replaceable batteries) replace the batteries in the trackpad, and try again.
Press the option/alt key five times to trigger the mouse-less interface; what’s called “mouse keys”. Alternatively, To quickly turn Mouse Keys on or off using the Accessibility Shortcuts panel, press Option-Command-F5 (or if your Mac or Magic Keyboard has Touch ID, quickly press Touch ID three times).
Change Alternate Control Methods preferences for accessibility on Mac - Apple Support (CA)
Control the pointer using Mouse Keys on Mac - Apple Support (CA)
If you’re really stuck and have no other mouse and cannot connect the trackpad via the Lightning cable and can’t get into Mouse Keys, you can press and hold the power button for ~ten seconds to force a hard shutdown.
And for troubleshooting:
If you can't connect your Magic Keyboard, Magic Mouse, or Magic Trackpad to your Mac - Apple Support