I too wanted to make my own engine, even knowing it would likely be wasted effort. I've spent like the past 7 years experimenting with various APIs and frameworks, and then also switching back to mainstays like Unity and Unreal in between. I don't actually know what the right answer is, as it will depend on what you want to accomplish and learn. So I do think there is value in custom engines in very specific cases. But I realize you just want advice and not discouragement, so I'll leave that as an open question.
My advice would be to download and play with as many engines as possible. Big ones like Unity and Unreal (or course), open source engines like Godot. Maybe look at OGRE or Panda3D or other programming only APIs. Get a feel for how to design a good API, what intuitively makes sense, what people in the scene are familiar with. You can borrow ideas from other projects, not stealing code, but reusing concepts like an entity component model, or scene graph, or things like that. Even if you don't actually build anything with them, read a few tutorials just to see how to load up a spinning cube so you get an idea. Or maybe just peek at the source code if available. At the very least you can see how vast a game engine code-base can be.
I would even go as far as saying you should try to write a simple game using your engine, before you write the engine. At least code up something simple like PONG or Super Mario Bros. (first level) in a “mock” API and imagine what the best design would be. Then you can work backwards and think what modules specifically would need to exist to support that interface. Granted, it won't be exact, but it will get your mind working on the right track and also inform the design based on the client needs (you being the client with a “fake” game already written). Otherwise you can get lost and start coding things that aren't necessary at first, or designing an obtuse API.
If you start with that you can probably learn a lot. You don't want to start by replicating Unity. That would be almost impossible, or at least a daunting forever project. But something more focused, like for one specific genre or even one game (think like a level editor on commercial games), that can be possible even for 1 person. But start as simple as you can and limit the scope as much as possible.
Also, don't try to reinvent the wheel on everything. There are lots of good small libraries for doing things like loading PNG graphics files or writing XML files, or playing sound effects, etc. Even big engines like Unity and Unreal didn't code everything from scratch. They still use PhysX for physics, or Wwise for audio, or all sorts of open-source libraries. So don't do everything from scratch. You'll find that your “engine” may do very little to no actual “work”. You can think of it like mortar that holds a wall of bricks together. It's more about creating an easy to use API and abstracting away the complexities of using each library on it's own. Though, you can then replace components of the engine later (if you design it correctly), for example if you wish to write your own physics engine or update to a new graphics API.
That said, what tools or libraries you pick could drastically alter how you design the API. For example, between going with OpenGL or Vulkan, I imagine could look very different. Or if it's C++ only, or you use a scripting language. Or if you want an editor or programming only interface. Or if you want cross-platform from the start, and also which platforms you are targeting. This can have a huge impact on even what IDE or programming language or OS you choose (for example Apple versus Microsoft ecosystems). So do research, it's not set in stone, but it can make your life harder if there are surprises later on in development and you spent 1 year going in the wrong direction (I've done this).
But don't let that stop you from taking action. The most important thing is constant practice and progress. So just get in there and start coding after you've done the other things I mentioned. It's actually not as hard as you think to get started. If you have programming experience, you can pretty quickly get stuff moving on the screen. It gets more complex as you get further, but you can learn as you go (and refactor, or remake things as you need). Good luck.