If you're using the latest version of Mac OSX and you're not using Safari browser (such as Google Chrome or Firefox), you must allow your browser to record your screen before you can share your screen – Control access to screen recording on Mac.
You must restart the browser before screen sharing works.
To enable screen recording on your Mac, launch System Preferences and navigate to Security & Privacy.
Scroll down the list and select "Screen Recording." You will see a list of apps that are allowed to record your screen. You can use screen sharing if you see your browser in the list with a ✅ next to it. If you don't see your browser or there isn't a checkmark, you must add your browser to the list.
To add your browser, first, click the lock in the bottom left so you can edit the app list. You will need to enter your computer's password to update your settings.
If you don't see your browser, click the ➕ button to open Finder. Navigate to the "Application" folder (or the folder containing your browser app) and select your browser.
You must restart the browser before screen sharing works. Upon relaunching the browser, you can share your screen. Unless you disable screen recording for your browser, you shouldn't need to go through this flow again or restart your browser. Happy screen sharing!