I agree with Robin2 that for what you describe there is no benefit to writing a library. However, it's certainly useful when you do want to share code between sketches so if you still want to learn how to write libraries I recommend following this tutorial:
After doing that if you are left with any specific questions you can come back to the forum for help.