This question comes up a lot and doesn t have a good answer. See, for example, the StackOverflow question "Advanced LaTeX Tutorial/Book".
My best advice is to read lots of packages sources, clsguide.pdf (it will be in your distribution), as much of the LaTeX sources (source2e.pdf) as makes sense to you, as well as TeX by Topic and any other TeX programming resources you have access to.
If you re particularly motivated you might like to read about the LaTeX3 programming bundle expl3, and other such programming-related packages such as etoolbox and etextools, which takes quite a different approach than expl3.