@gonzdi the following should do the trick with the searchbutton:
#searchbox {
display: none;
}
Not displaying the settings button in files app is way harder, because the simple way would hide the settings button of ALL apps, not only files.
If your users are in a nextcloud group, you an limit the customCSS app to this group in app administration.
You can see the needed class and id names in the source coude of the webite. You can view this in your browser.
But ATTENTION: The buttons will only be hidden. Someone with technical knowledge can make them visible and use them. It’s not possible to prohibit the use of a button via css.