Second, it's not you, it's the programmer labor market. There were a lot of layoffs in Big Tech in the first half of 2023, and the labor market hasn't absorbed all of that yet. It will, and then being a programmer will be a good job again.
Third, to survive in the meantime, you may have to take a crap job for a bit, if you are having trouble paying the rent. That doesn't mean you should stop programming, but you do what you have to do. If you have a cushion to survive on, great, but don't be afraid to take a low-wage, non-professional job for a year if that's what's required. By the way, lots of small to medium sized businesses, if they find out one of their line workers (whatever that is for that industry) can work with computers, will start putting them to work on that (though you would have to be willing to be a jack-of-all-trades). It's not guaranteed, but it happens.
Fourth, remind yourself frequently that this is not about you, it's about the particular place the programmer market is now. You need to have an optimistic attitude going into an interview, so make it part of your interview-readiness routine to keep focusing on positives. One case where "fake it 'til you make it" is a good idea.
Fifth, there has been a shortage of programmers for every year in the last thirty except for probably 2001, 2008, and 2023. It will pass. Just do what you have to do to keep your head above water until then.