You cannot search for everything on Mastodon. You can search for what your server knows about, based on what you and other people on your server have followed and boosted.1
That is deliberate for two reasons. Firstly Mastodon wants to avoid having any central place for searching, which would provide a choke point for one organization to exert monopoly control.2 Secondly Mastodon does not want to make it too easy to find everything on Mastodon, as that would make it too easy for trolls and bullies to find victims to harass.
Hashtags provide a nice compromise. If you add one to your post you are implicitly advertising that you want your post to be found via that hashtag. So Mastodon makes it possible to search by hashtag, but only for those that your server knows about. If your server is getting a flow of data from many other servers then you may be able to find what you want by searching via your server. If you want to search more widely you can use this site.