How enable disabled material in runtime unity

Hello everyone. I Am using HDRP Pipeline in Unity. I have multiple materials on one object, and I want to enable and disable one material during run time, I did try a lot by Scripting from online resources but Script is not working for me. I don’t know what’s wrong with me anyone can help me with that, please? thanks