There isn't a global way to prevent a folder being examined by Find or Search.
When using Windows Search (as you are in Default search in folder with toolbar search?), it looks like you can add
-folder(C:\Path\To\Folder) to the search query string to exclude certain folders (found here).
To exclude a specific folder’s contents, along with subfolders and their contents, the path to that folder can be specified with a minus sign as in this example syntax:
If you know that the folder has a unique name within the full area that you are searching, then you can leave off most of the path, as in:
If you instead want to permit searching inside of subfolders of such a folder, while still excluding files that are immediately inside of that folder, then use:
You can use multiple instances of the syntax to exclude more than one folder.
When using Find (Advanced) with a filter, you can filter by location or sub-folder, but then everything has to be defined by the filter (at least currently; we plan to make that more flexible one day), which is less useful if you want to automate things while still feeding in key parameters (e.g. the wildcard) via a simple prompt.