How to change a Custom Material of a part with a Script?

I’m trying to change a custom material of a part to another custom material in-game using a script. how would I use MaterialService to do this? or is there a better way to do it?

Nvm. Something was wrong with my capitalization.