One way to restrict access to non-SEO URLs in Joomla 3 is to use the built-in "URL Routing" feature. This feature allows you to create user-friendly URLs for your content, which can also help prevent access to non-SEO URLs.
To use this feature, go to the "Global Configuration" menu in the Joomla admin panel, and under the "Site" tab, select "SEO Settings". From there, set "Search Engine Friendly URLs" and "Use URL Rewriting" to "Yes", and then save the changes.
Once you have enabled SEO-friendly URLs, you can use the "Redirect Manager" in Joomla to redirect any non-SEO URLs to their corresponding SEO-friendly URLs. This can help prevent users and search engines from accessing non-SEO URLs on your site.