Add png texture to mesh via script

I’m trying to add a .png texture to a mesh at runtime with the following code, but when I run the code, no colors/textures are added and a window pops up in the bottom of the inspector window showing a blank ball called “No Name (Instance)”. What could I be doing wrong, and how can I correctly add this .png to the mesh so that it has colors?

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

public class AddTexture : MonoBehaviour
{

    Texture t;
    string pngPath = "Materials/color3";
    Renderer objRend;
    // Start is called before the first frame update
    void Awake()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        objRend = this.GetComponent<Renderer>();
	t = Resources.Load<Texture>("pngPath");
	objRend.material.mainTexture = t;
    }
}

t = Resources.Load(“pngPath”);

this line will try to load the file called “pngPath.jpg” in the assets/resources folder

but I see you have a string called pngPath that you set to be “Materials/color3”
So, I suspect you mean to write the line as

t = Resources.Load<Texture>(pngPath);   //quotes removed, so it uses the variable instead

this will load the file called color3.jpg in the assets/Resources/Materials folder