As posed in question the way to retrieve the current URL to the root of the site would be site_url()
home_url()
for site's front-end.
However there are multiple functions that deal with URLs to specific kinds of pages. It's not clear what you are linking to (post? page? archive?), but there are likely specific URL-forming function for it which should be used over constructing such URL "manually" from the root address.