The best way to learn a skill is where your comfort lies. If you are comfortable learning from a book, then buy a book for that and practice as much as you can or if you are comfortable learning through an online course go for that. However, online courses have an edge over books as they give you the complete roadmap from learning to bagging a job in that skill.