Youtube tutorials are famous for teaching very bad code style, so that is not suprising
The only way to learn C++ and good coding pratices is reading books. You should start with a beginner book (e.g. C++ Primer) that explains all the language and standard library feature. Even if you don't consider yourself a beginner, there are a lot of subtle differences between Java and C++ that you should know, and only good books cover those in-depth. Tutorials omit many important details, and of video tutorials I don't even want to begin to speak.
After that, you should read an advanced book that teaches modern idioms like RAII and techniques like exception safety or efficient use of STL. The classical book for this was Effective C++, but some of the rules taught by it are not up-to-date anymore, but in general you can probably still learn a lot.
It may sound demotivating, but reading such books still takes far less time than the maintenance and debug sessions arising from bad code. Furthermore, it is not nearly as frustrating. You should really invest some time, C++ is a very complex language.