It's the first option on the title screen. It's to the right of your Minecraft server in the list of games under the Worlds tab. It's the second option in the sidebar menu to the left. You may have some friends that appear in the list at the bottom of the screen.  Click or tap Invite next to any friends you want to invite. It's the second link at the top of the Members menu.  This displays a URL you can use to invite people to your server. It's to the right of the URL at the top of the page.  This copies the URL. When sending an invite message to friends, paste the URL to invite friends to your server.  This allows your friends to click the URL and receive instructions to join your server.  You can paste the link on PC or mobile devices.

Summary:
Open Minecraft and click Play. Click the pencil icon next to your Realms server. Click Members. Click Invite next to any friends. Click Share link. Click Copy. Paste the URL in messages to friends.