The problem when trying to do this kind of thing is that PowerApps is declarative and not procedural. So you can't use a button to change the value of a property, like the Items property of the gallery directly. What you have to do instead is to build your Items property to be based of the value of a variable and then use the variable in the Filter statement of the Items property of the gallery.
For example, Assume I want to filter based on a text field containing a specific name. My Items property on the gallery would read like this.
If(IsBlank(TargetName),'Data Source Name',Filter('Data Source Name',TargetName in Title))
then set the OnSelect of the Button to
set(TargetName, "Value to search")
when you click the button the variable will change and the filter will be applied