How do I paint a 3d model at runtime?

Id like to paint a gameobject at runtime (a car for example) but Im pretty lost where to start with.
I do undestrand how raycasting works and what I’ve done so far is that I have instantiated dots at raycast point when pressing button. I have also succesfully set the instantiated dots rotation correct based on the surface where it hits.

However. Instantiating a dot isnt what I want. Ive read about setpixels (from which i dont understand a thing) and tried to google some info but still I’m clueless where to start with. Rather than pasting some random script that works, any video tutorials or other guides would be very welcome.

watch THIS (from the linked time, for 30 minutes)

use mesh.colors to adjust your colors

Use a shader which uses vertexColors on your material

use meshCollider when you are painting, and raycast on it, to locate point of intersection, then search for the nearest 3 points & paint each point with a corresponding percentage.