The first thing you need to do is accept that you can't have everything you're looking for and that you have to explicitly decide on the tradeoffs you're comfortable with. The best writing on this subject comes from Tim Urban, in this lengthy but worthwhile essay: https://waitbutwhy.com/2018/04/picking-career.html.