Looks like you are on server, there's no "atlassian.net" in the confluence URL, right?
There are two steps.
1) create the anchor using macro (I've created anchor with name "my anchor" on the page "Test page")
2) navigate to the other page, where you want to have your link and during inserting link go to the "Advanced" section.
Insert special link here, it is based on the name of the page and name of the anchor:
Hi Atlassian Community, Remote work has shifted how teams collaborate, and we’ve heard from many of you that Microsoft Teams has become mission critical to many of your workflows, from how you chat...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events