If you're posting a public post on the Fediverse, it will be visible to anyone, even people who aren't on the Fediverse. Every account has a public profile page, which lists all the public posts made by that account.
If you want to keep your Fedi posts off search engines, the best way to do this is to use a non-public visibility setting such as followers-only or mentioned/direct. Search engines cannot see posts with such visibility settings.
On Mastodon, you can also go to Preferences > Other > Opt Out Of Search Engine Indexing, tick the box then click Save Changes. In theory this setting also stops your public posts from ending up in search engines, but in reality it's up to search engines whether they respect your request.
PixelFed has a similar option in Settings > Privacy.