The gold standard of learning Spanish is one to one, face to face teaching from a native Spanish speaker (preferably a Spanish course in Spain). Given that this is hard to organize or prohibitively expensive we must sometimes take advantage of other methods to increase our knowledge.
There are many online Spanish courses, some with just written texts, some with pre-recorded study material, and some with live interactions with teachers via video chat. Regular practice of any kind is a positive thing, but a course featuring the opportunity to speak live with a native Spanish speaker is a pretty good substitute for in person learning.
An online course with a live native speaking teacher covers all of the areas of Spanish language study. Listening, speaking, reading and writing.
But by just doing an online course on its own you are missing out on the chance to combine learning techniques and have them feed off each other. Doing a class, plus reading around the subject matter covered, plus listening to Spanish language radio or YouTube, plus studying a chapter of your preferred Spanish grammar book will all reinforce each other and make your understanding and knowledge retention much more robust.
Like any other method you must actually follow through and do the work involved. An online Spanish class is not just an excuse to use the internet for an hour without feeling guilty. To extract the full value you must do any preparatory work required, pay attention during the lesson, try your hardest to interact fully and follow up with homework and complimentary study that will help the lessons stick. The purpose is not to do just the class, it is to learn Spanish.
Online learning requires self-discipline. Unless the course has fixed times for you to learn, you must actually put in the hours, just as with any other more traditional method of learning a foreign language. Some people find that having paid for a course makes them more likely to follow through and get the most out of the new resource, so as not to feel like they have wasted their money. Perhaps the effect is not so strong if a parent has paid for the course, but that situation has its own particular advantages. In any case, an online course is a more convenient option than actually living and working in Spain, and maybe even cheaper than traveling to in-person classes each week.