It depends on your budget. I am always goign to recommend a glock 17 or 19 for a first gun. They are reliable, well known and should be easy to find parts or a gunsmith for in a SHTF situation. That being said, a used one is around $400.
My first handgun was a Glock 17. Almost too big to conceal carry so I carry on my hip most of the time. Glock 26 fits in my pocket.
You can often find used police G17s ones for under $350.
I also wouldn’t rule out a revolver, especially one without a hammer to get snagged on anything.
One thing I don’t like about my Glock’s are the width. Because the magazine is double stacked it’s fatter than some other handguns on the market. The nice part about 9mm in the Glock 17 is that you can get 17+1 shots.
I carry my Glock daily, but I’m looking for something thinner, but it’s a trade off with the number of rounds I carry. G17 plus extra mag I carry = 35 rounds, plus sometimes I also carry the Glock 26 with 10 rounds ( or my wife does ).