To break it down a little more: come up with a game you want to make. Start making it. You'll figure out how to make an engine as you start making your game.
To break it down even more: I wanted to impress an old girlfriend by making a clone of Galaga, cause she loved it as a kid. I decided to make Galaga in HTML5. I wanted to start by rendering the ship to the screen, so I went down that path until I could do it. How do I draw something to the screen on the web? Use Canvas - figure out how to reliably render a canvas element on the page and fill it a color. How do I draw an image? Draw sprites on the canvas - get a sprite of the ship then figure out how to draw it. How do I move the ship? Create a backing representation of the state of the game, then render the world based off that. I now have a simple game engine and an emerging game.
So code more! Could be hacking on games, could be doing other programming. But once that software design muscle is big enough making an engine will seem more obvious than ever.
The generic, one-size-fits-some advice is: Go and make three games, and by the time you’re done with the third game, you’ll have a clear idea of what you want from an engine.
Basically, game dev is a hobby for me so I'm in no rush to actually publish a game. I'm interested in learning nearly every aspect of how games are made.
I've already been playing around with Unity and Game Maker Studio a bit. I'm continuing to learn Unity but rather than spending tons of time learning how to use a game engine's libraries I would prefer to learn how these things are built and make one myself.
I wrote a little advice comment on simple game engines recently: https://www.reddit.com/r/gamedev/comments/fr986w/game_engine...
Repeat this over 20 years, rewrite from scratch every few years, switch to unity, unreal, then back to another rewrite!