There are two different approaches to writing a game. One is to start from the very basics, like raw OpenGL calls, and build from that. You're basically building your own engine that way.
The other end of the spectrum is to use a preexisting game engine. There's the open source Godot Engine. There's the Löve Engine. The Blender suite has a game engine included. Unity 3D is free for personal use, the older id Tech engines are open source, and now even the Unreal Engine can be had for 19 monetary units a month! The list just goes on!
So the choices are endless, overwhelming even. If the goal was to bang out a game, it would be simpler: use an existing engine. But I'm a programmer, and programming and tinkering is half the fun. Plus I like writing engines themselves (or at least starting them, admittedly).
But how can I write my own engine, if I have no experience with game engines? Do I need to know what other game engines do? Or is it enough to develop what I need when I need it?
In the end, knowing me, I'm going to tinker around with a lot of these. It may not get me anywhere, but I'll have to accept that I'm still, even at this point in my life, in the searching stage. And for now, that will be both the journey and the destination.