Open it by pushing a button - Abra apertando um botão
By
When we describe the method to do something, we use by + verb (-ing form):
With
When we mention the instrument used to do something, we use with + instrument's name:
Note: We can also use by when referring to means of transportation or anything related because that is the method of transportation: