The best way to understand how Vertex and Fragment Shaders work is by creating one yourself. This recipe will show you how to write one of these shaders, which will simply apply a texture to a model and multiply it by a given color, as shown in the following screenshot:
Notice how it works similarly to how the Multiply filter in Photoshop works. That's because we will be doing the same calculation done there!
The shader presented here is very simple, and it will be used as a starting base for all the other Vertex and Fragment Shaders.