How can I make a material change on bullet impact?

The game is super simple. You shoot a ball and it changes color. The color is defined by keystrokes 1, 2, 3 and 4, which generate yellow, red, green and blue.
The ball should change to the color selected.
I have already created the key mappings, so that the gun changes to the color selected, but I’m a noob and don’t know where to find the blueprint tutorials for this specific thing.

set material Set Material | Unreal Engine Documentation