If you are currently enrolled in a beta programme and wish to return to using the current production version, this support page provides the necessary information to remove the beta from your iPhone:
How to uninstall iOS beta software - Apple Support
Be aware that restoring an earlier version of iOS will completely reset and erase your iPad. Assuming that you have a pre-existing iCloud or iTunes backup of your iPad that has not been updated since installing the iOS 26 beta, your locally stored data and files can be restored after returning your iPad to iOS 18.5; if you don't have a pre-existing backup, all locally stored data will be irretrievably lost:
Restore your iPhone, iPad, or iPod touch from a backup - Apple Support
An iCloud or iTunes backup can only be restored to a device running the same or later version of iOS than created (or last updated) the backup. As such a backup created or updated by iOS 26 cannot be restored to a device running iOS 18.5.