I understand. There is definitely a learning curve. I had very little firearm experience growing up...just shot some .22s with Grandpa.
Started learning about firearms more in 2012. Pursued concealed carry permit a couple years later.
If you choose to go down this road, I can offer you the benefit of my experience as far as maintenance, assembly/disassembly, ammo choices, after market upgrades, and all that goes.
You're right that it can get expensive, especially at first. It's not just the pistol. It's the ammo, multiple holsters, cleaning supplies, specialty tools, spare parts, etc. The good news is it's a "cry once, buy once" situation plus guns tend to appreciate in value keeping pace, to some degree, with inflation so at least there's that lol.
For your consideration, I would figure a brand new Glock with ammo, holsters, cleaning supplies, a few helpful specialty tools, and a few "must have" after market upgrade parts, you're in for under $1000. Gun itself is probably $600 of it.
One must have is night sights. Tools required. Totally worth it though for your tool to be useful 24/7 instead of only in well lit conditions.
Note: There are other brands out there. Glock is sort of a Goldilocks zone choice IMO. Not expensive like a Kimber. Not cheap like a Hi-Point. Very resilient and reliable. They're everywhere. After market parts are everywhere. Lots of pluses. Some hate Glocks and Glock copycats because the grip angle is slightly different from 1911 style pistols which are and have been popular for over a century.