Universal Control apparently stops working for any of several possible reasons. Most common: whenever either system goes to sleep (for whatever reason). To have get Universal Control to reconnect, on the Mac with the keyboard & mouse, make sure that Preferences -> Displays -> Universal Control "Automatically reconnect ..." is checked. And wake up both systems.
If you have a System Preferences window open on the Mac, a little picture of your iPad should show up next to your Mac display there when Universal Control reconnects (re-Links). If you don't see it show up there after, say 10 seconds, go to the Add Display dropdown. You should see the name of your iPad under a sub-heading called "Link keyboard and mouse". Click on the name of your iPad and a checkmark should show up there, indicating that Universal Control between your Mac and iPad is linked now.
[The name of your iPad may also appear below the subheading "Mirror or Extend to" in the Add Display dropdown. Do NOT click on that. If you do, your iPad will become a Sidecar display for your Mac, and Universal Control will not work with your iPad until you turn Sidecar off.]
If you're not seeing the name of your iPad in the Add Display dropdown on your Mac whenever both systems are both awake, then there's a problem with the Mac and iPad communicating with each other either via WiFi or Bluetooth (Universal Control uses both) or authenticating their communication (using the same Apple iCloud ID), or something (often that would be a VPN or firewall) is interfering with their communication.