Learning to code is a difficult practice to learn, but is not out of reach for anyone - nor does it have to be predicated on a computer science degree. A huge part of picking up coding as a skill is maintaining a good work ethic and staying motivated. Before learning how to code, the student needs to learn how to learn effectively. Absorbing and retaining information is one of the base skills needed to become a competent software developer.
There are ample resources available online to facilitate a student learning coding by themselves. Some of the most reputable sources include khanacademy.org, codeacademy.com and codingdojo.com, who provide interactive tutorials that encourage direct engagement with a programming language. The hands-on approach is widely regarded as the best way to learn how to code, and these resources are extremely useful in aiding self directed learning. A mentor or study partner can also be of great benefit while learning - a source for feedback and criticism can help compound what is learned.
Each programming language has official documentation available which should ideally be their primary preference should they get stuck. Websites such as Stack Overflow, Quora and Yahoo Answers provide a question-and-answer style forum for developers of all levels who have ran into issues and need support.
Practice is probably the most important aspect to teaching yourself how to code - a student improves their coding skills by doing it often, rather than by just accumulating knowledge in one area. One of the best ways students teach themselves is by outlining and undertaking a personal project in order to stay interested in the work and keep motivated.
One of the most important things to consider while learning to code is the importance of understanding the fundamentals of programming. These will form the basis for almost any programming language a student may encounter. They are unavoidable, so a student should aim to learn them from the very beginning.