Reminder: Nobody is a "perfect" or "finished" programmer after just one course of C++! On the contrary. You have just started. Your feeling of not having learned enough is right. Don't let that frustrate you, let it spark your future endeavours!
Approach: For solo development, start learning a language and trying to develop a game (or some small project) in parallel might be beneficial. Because you learn new things to experiment and reproduce during reading about game development techniques. This automatically drives you to learn new concepts of the underlying language to realize those tasks. You also stay focused on game development this way.
Trying to "first master the language" will carry you far (off), and maybe waste time on things you do not really need later.
Generally, there is no "best way". Only a best way for you. So, I recommend, do what you find is easiest for you. This will get you far(-thest) with small(-est) effort. That is what you want in the beginning.
Language: C++ is common in the gaming industry and it is used with Unreal3D. When you go solo, you have the opportunity to also use different languages which are easier to learn at the beginning. Unity for example uses typescript (a kind of JavaScript) or C#. Especially typescript is more forgiving than other languages, but because of the things you can leave out, it might also be harder to grasp the underlying concepts.
3D or 2D: Depending on the type of game, maybe a simple GUI/window is already what you need. Consider Java for a few months, just to get the basic concepts of GUI development, might help a lot. There are plenty of tutorials and very good IDEs for it (IntelliJ IDEA, Eclipse). If you want to stick with C++, check out QT for GUI development. LUA or Python may also be worth to have a look at (depending on your project demands).
Delphi/Freepascal: Concerning GUI/2D also consider to do some Freepascal experiments. Download LazarusIDE and look for tutorials for Freepascal or Delphi (they are essentially the same). I know no other system where you can do GUI stuff so quickly and intuitively. Having buttons do something or an image moving around the screen by key presses is done in virtually no time (mere seconds, if you know what to do). Because of the ObjectInspector concept to change properties of elements, it serves as intermediate step towards Unity nicely.
3D-Engine: In my opinion Unreal is far more capable of supporting also huge games, while Unity is more of a sandbox and for smaller games. This can be very helpful at the beginning and enables you to make progress quickly. But also have a look at Unreal at some point to see what benefits you get there. The switch to C++ might be harder if you are used to C#/typescript in Unity then. Don't get repelled by that, if you think switching would benefit your projects. Be prepared to start over.
Also keep in mind that even if it says "3D-engine", you are very well able to do 2D games with them as well (also if they are more GUI focused with less graphics). With the added benefit of having support for sound, networking, animations, nice graphics and other stuff.
Courses: If you can do online courses, I would recommend doing so. Even if you are unsure about them, try one and find out! The next time you will know in more detail what to lookout for. You can always cancel/abort and search a different course (okay, if they cost something, this might be a bummer. Set yourself a budget you are willing to invest=loose in you learning efforts, that helps making decisions.).
Tutors: It is always good to have someone showing you things which you can try to replicate yourself. So even YouTube tutorials might work. If you have contact to a tutor during such lessons even better, then you can ask questions as well. If you have the opportunity to take beginner-level courses in a university or other places, that might be a good kick start, even if it is just a few months.
Keep in mind: Regardless of what step/course/tutorial you take, it enables you to realize what next step you need - so don't shun making a step! You need steps to make progress! Many of them will be "failures" you might think, but in the end all those steps will form your base of experience! Value them.
Advanced knowledge: Game development is a broad field. There is not only graphics to it. Also modelling, animations, sound, input, story, level design, multiplayer/network, databases, saving/loading, etc. are part of it and have different tools to get familiar with.
Also some lessons in clean code, unit testing and refactoring, and non-programming related topics like marketing, how to publish, monetize (micro-transactions), founding a business, doing taxes, and "getting things done" e.g. structured approaches for development and work organization, might be very helpful.
Company/Career/Experience: If you want to pursue a career in a game development company, I strongly suggest try to get a foot in the door early. Do some internship or what you can get hold of. Accept a small job, even if it is paid bad for a beginner and is maybe not yet the final position you have hoped for. The earlier you start becoming part of the gaming scene, the easier you'll have it. Also, you will realize much faster, if the whole thing is not what you want.