Say I view a lemmy post or mastodon toot on a different site, getting there from a link shared via any other medium: how do I view it through my home instance?

For example if I view a lemmy.ml thread on lemmy.ml, I can read it but can’t a comment or vote as I’m not ‘logged in.’ Presumably the solution is to convert the URL to a lemmygrad one, but I’m not sure how to go about it. The URL usually has just a post ID, which presumably is unique only to that instance, and not something my home instance would necessarily recognise.