Freaking out about the $400k in loans school will take

I guess I’m just posting this to look for advice from anyone who’s been through school or starting to repay loans and how people are coping with it.

I got into a school I really like and am planning on attending this fall. As such, I’ve started really sitting down and trying to figure out finances and such to go to school and starting to freak out. I don’t have family support and my school doesn’t really do financial aid/scholarships so it’s looking like I will be taking on ~at least~ $400-410k in debt, probably more. I am very lucky to not have undergrad loans from a full scholarship, so I just can’t get over how mind boggling this debt is. I’m not going to be a doctor for the money, I’ve wanted to be one forever and I want to be in it to help people; but when looking at it practically, I do want to be able to pay off my loans and have a stable job with a somewhat nice lifestyle after all the work to become the doctor. But going to a DO and also with my interests I don’t expect to be in a super high paying speciality. So even with what’s considered a very aggressive payment plan I probably won’t be able to pay those off until I’m basically 50 (starting med school at 26), and that’s if i can get federal loans. It’s enough to just make me feel like oh my gosh is this really worth it? I know it’ll suck, but the grueling years of school and residency and the sacrifices you make don’t make me feel like it won’t all be worth it to be a doctor. But this is absolutely terrifying me and I’m worried about the financial impact this will have on my quality of life for like most of my life

Does anyone have advice on how to cope with this? Does it end up being not that big of a deal once you’re working, and I’m just freaking out about it now? Any advice would be appreciated lol.