The general case of selecting an arbitrary sound, then searching for that sound, is very difficult to implement.
There are specific cases that are much more simple. For example, to look for “all occurrences of sound that have a peak level above a specified threshold” is relatively simple to achieve. This is essentially what the “Sound Finder” effect does: Audacity Manual
Moving one step up in complexity; looking for a “beep” that is at a specific frequency is not too complicated, The audio can be filtered to pass only narrow frequency bands that correspond to the frequencies contained in the “beep”, then the filtered audio searched for where each of those frequency bands has a signal that lies within a specified amplitude range.
Moving further up in terms of complexity; The “needle” sound could be analysed for its frequency content using FFT analysis, then searching for a similar spectrum profile within the “haystack” audio.
For the general case you need to be searching for a sequence of spectrum profiles. A little about this has been written here: Missing features - Audacity Support