I want to change a mesh material with a button

Watch dynamic material instance tutorial.
Use dynamic materials for that, mark mesh as dynamic.
Make sure you are not applying that stuff every frame (ie. every tick)
Watch tutorial about blueprint communication.
make event dispatcher for changing materials, or for now change then on key press, like 1 for one 2 for another, to rule out that you messed some logic in blueprint code.