They shit on everything user, it's the same as here, everyone has individual preferences.
First, props for deciding to learn to program.
What I did first was decide which language I was going to actually use; thus the first decisions is which engine, and hence which language.
This will give you a good starting point, and will give you a direct purpose for learning everything you can from here on in.
F.e. Unity uses C#, UE uses C++, and other engines like love and such use LUA… GM uses some amalgamation of a few languages.
During the next steps, remember to not overwhelm yourself. Take it slow, and keep in mind that each concept of programming you take the time to learn will help you avoid defunk code, and hours of wasted time which could've been avoided; if you'd only known about the relating concepts (w/o having to reinvent the wheel from some perspective of not knowing how to approach the problem).
As being a competent programming is mixture of knowing your stuff, and being resourceful.
So, what I mean when I say, "don't overwhelm yourself", is in the sense of pacing what you're learning, and to take the time to learn all of the mundane, simple, and fundamental concepts without skipping anything.
Even if it seems trivial, just typing it out and getting the output desired helps you learn the concepts, adds some motivation, and how to approach a similar problem because you've put it into code before.
—
Once you know which language you're going to use, you'd be smart to at least learn the basic foundation of all programming languages; in addition to implementing into code or on paper while learning them.
That is, what is a pseudo-algorithm (how do you write one, and write a few out, implement them into code), what is data types, conditionals, loops, functions, methods, and it would be advisable to also be familiar with the most common design pattern; OOP (object-oriented programming).
Through this, you'll understand how to approach a problem, and how to put a proposed solution into code.
NOTE:
If you cannot find good resources, and are not too confident in learning on your own: use a site that has courses with an instructor (linda, coursera, etc), and the focus being an introduction into the language; they will go over all of these concepts.
Practice everything they give you, and do some practice on your own to see how you can break it, and how you can fix it, and how you can do it in another way.
If they do not go over OOP, I recommend doing some course on this; as you're learning how to use a design pattern, which is fundamental to having organized code, and learning how to approach a problem using said design pattern.
This is extremely fundamental, and will help you in many ways I'm not mentioning.
After you've learned this, and have become confident in your ability to code basic to intermediate programs, and how to break them + fix them; you can start learning things relating to your engine, and using the language you've been learning in-engine.
The design pattern you're more than likely going to be diving into with the engine, is ECS (entity-component system); which afaik is used in Unity and UE. So, it would be best to familiarize yourself with this design pattern, and since you have experience with OOP; you have experience in using a design pattern, and can adjust your thinking accordingly.
When doing coding in-engine, and using the language; there will more than likely be an abundant amount of guides.
Use those resources, and note that you will be ahead of the curve since you have practiced beforehand.
Learn each of the systems (going back to ECS), and how to use their components (ECS) in code with an entity; then make a practice project using these different systems.
After this, you can start, but even with this abundant preparation be prepared for defunkt code, and rethinking your approach; as it's apart of being a programmer.
Although, that foundation of knowledge will help you even recognize there is a better approach, and how to catch potential errors/bugs/etc before you move on and create a chain of ghost like bugs); in addition to knowing how to put imagined mechanics into code, and seeing those results we all want.
Best of luck user!