Having done this both ways I can tell you there is certain value in going to class. For earlier math such as algebra through pre-calculus it's probably sufficient to learn online. I would not use youtube or coursera, but rather MITx which I will explain in a few.
However, if you have a community college that offers night classes at an affordable rate I would choose this path. The reason being once you reach calculus and beyond having a real living human being there to help you understand the concepts is something that is invaluable. Especially Calculus 3 (or the equivalent "vector calculus" course) where it gets very hard to wrap your head around things like divergence, curl, flux, etc. Calculus based probability is another course where having someone available really helps. Personally, things like differential equations can probably be self-taught if you have a very strong foundation in calculus. But if you're not strong there, you will want to also take classes at the university for that.
If you can't get into a class for whatever reason and you want to go online I would use only MITx. I've taken several online courses from them and the quality is superb. They run courses with real humans available for questions and you can usually get things answered quickly. Pay for the verified track for leverage.
It goes without saying you also should spend time on a forum dedicated to math. Physics forums is a good place where you can ask questions and get answers.
I highly recommend also looking into the open university (https://www.open.ac.uk/courses) as an option. Their costs are affordable and the education is top notch (though strangely organized if you're from America).