Please the following steps to enable external sharing link:
1. Set the Site sharing settings
- Sign in the site as an admin
- Click Site permissions under the Settings menu
- On the Permissions panel, click the "Change how members can share" link

- On the Site sharing settings panel, select "Site owners and members can share files, folders, and the site" option

2.Set the Site external sharing settings
- Sign in the SharePoint admin center as SharePoint admin or Global admin
- Select Sites tab under the left navigation, and select Active sites

- Select the site that you want to share
- On the Site information panel, go to Policies tab and select Edit External sharing

- On the Sharing panel, select Anyone option under the External sharing section.


=======================Updated Answer==========================
For public sites you only need to set the Site external sharing settings.
- Sign in the SharePoint admin center as SharePoint admin or Global admin
- Select Sites tab under the left navigation, and select Active sites
- Select the site that you want to share

- On the Site information panel, go to Policies tab and select Edit External sharing

- On the Sharing panel, select Anyone option under the External sharing
section.

