Something like a sticky note that can be hidden from a note

I’m not entirely sure I fully understand your request, but collapsed Callouts comes to mind, as a potential candidate.

Then you can write it, and in the reading view it’s hidden, but can be uncollapsed at will. And you can search them just like normal text.

In the image I’ve duplicated the note, where the first is collapsed, and the second is uncollapsed by default. The change is the added dash/minus, aka doing > [!info]- ....

With a little bit of trickery, you can also include them in dataview queries, or style them according to your own needs, if neccessary/wanted.