The one thing I really wish I’d known when I was 23 is that there is plenty of time left to pursue a life well-lived. Which is to say, you can always start over if your primary plan doesn’t work. Knowing that makes the prospect of failure livable. Failure is the best path to success, and thus worth the investment.
I speculate that you want to go the lawyer route, but are afraid of failure. If that’s the case, go for it. You could also pursue teaching law, which would combine both.
Tech will eventually replace all jobs — but it almost always creates new ones as it does. And those new jobs usually come from the ideas of those replaced by tech. I wouldn’t worry too much about that, it’s a societal concern with little long term merit.