Not allowed to access Renderer.material on prefab object. Use Renderer.sharedMaterial instead

Hey everyone, i am a beginner at unity and i’m trying to make a endless runner game that has a shop in it, but when i try choosing the color it says,

Not allowed to access Renderer.material on prefab object. Use Renderer.sharedMaterial instead

Can you please help me in this (responses would be appreciated)

Here is the code (please help) also i tried looking for videos on shared materials but did not find it, if you could help me in this also it would be appreciated

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ChoosingColour : MonoBehaviour
{
    public Material[] BodyColorMat;
    Material CurrMat;
    public Renderer renderer;

    void Start()
    {
        renderer = this.GetComponent<Renderer>();
    }

    //render blue color
    public void BlueColor()
    {
        renderer.material = BodyColorMat[0];
        CurrMat = renderer.material;
    }

    //render red color
    public void RedColor()
    {
        renderer.material = BodyColorMat[1];
        CurrMat = renderer.material;
    }
}

If you need more information please tell me, Thank you

Kindly note that this has been solved…
I solved it by adding my shop into the level… not the menu
i didn’t use the prefab i used the GameObject