Shaders are confusing and hard to learn at first.
The best way to learn is to mess around with someone else's shader.