If your chosen browser isn't sticking, here are a few things you can try.

A web browser is arguably the most important application on your Mac. It allows you to access the internet, check emails and connect to various online services. While your Mac already comes with Safari as its default web browser, it may not be the best fit for your particular needs. You may prefer Google Chrome for its seamless integration with Google's services, Mozilla Firefox for enhanced privacy and security or Microsoft Edge for its productivity tools. You may also choose to use the same browser on your Mac and smartphone to sync history, bookmarks and passwords.
No matter which browser you prefer, macOS allows you to set it as your default browser. However, at times, you might notice web links opening in a browser other than the default one. This may occur if a software issue prevents the browser preferences file from saving correctly or when you accidentally confirm a browser prompt to set it as your default browser. Knowing how to change default browser on macOS can help you resolve browser-related conflicts and understand why certain web links may open in different browsers.
How to change the default browser in macOS?
Changing the default browser in macOS is fairly straightforward. Click the Apple icon in the menu bar and then click to open the Settings app. You can also search for using the keyboard shortcut.
Once in System Settings, click . Then, scroll through the options presented in the right-hand pane to find the Default web browser picklist. This lists all third-party browsers installed on your Mac in addition to Safari. Pick the browser you wish to set as your Mac's default, and confirm that the picklist shows the change before closing the Settings app.
It's also worth knowing that most browsers include options to set them as your default browser. However, rather than investigating individual settings menus across individual browsers, it's more convenient to use macOS' Settings app to change your default browser. Once changed, your Mac will now prefer the newly set default browser to open web links from supported applications and ensure a consistent browsing experience across your Mac.
If your Mac fails to retain the default browser and keeps reverting to the one previously selected, try restarting your Mac. If that doesn't help, restart your Mac in safe mode and try changing the default browser again. You can also try running Disk Utility First Aid from macOS Recovery to check and repair disk errors. In one reported case, running the utility resolved the glitch.
Why some web links bypass your default browser?
Sometimes, despite changing your default browser, some apps may continue to open web links in an embedded browser window. This is possible because of Apple's WKWebView, a technology that developers use to display web content within an application itself, without opening a separate browser window.
Another reason is that certain web links can redirect to installed applications instead of a webpage. This happens because of Apple's Universal Links feature, which lets web links open directly in an associated app instead of your browser. If you uninstall the associated application, the same web links should open in your browser instead.
Understanding these application-specific behavior can help you differentiate them from changes to your default web browser. If you notice apps opening in embedded browser windows or web links redirecting to installation applications, it doesn't necessarily mean that your default web browser has changed. Your selected browser should still open most web links that macOS directs to it.