You're a lot younger than me. I've lived a long and twisty road just like most everyone else so I'm not special in that regard but I'm pretty experienced. You'll appreciate my story. It will give you some perspective.
I had the sweetest gig ever from 2000-03. I was working for a well connected and pretty powerful Gov contracting firm in the financial services industry. I was young, gung ho, well liked, and very well compensated. I got married in 2002 and bought a house in 2003. When I was house shopping one of the principals of the firm told me to go big with the home (I didn't because I'm not like that) but he told me I was going places. Big places. And that money was not going to be a big problem. Yay for me right?! Nope...
In June of 2003 (exactly 1 month after I closed on my house) the firm I worked for lost 2 of their big contracts and the Gov announced it was scaling way back on financial services work. Guess what...I was laid off just like that. Big mortgage and no job. LOL. Oh how life is funny sometimes. I went into scramble mode. MUST FIND WORK IMMEDIATELY ran through my mind 24/7. I made a lot of good friends/contacts during my stint in DC so I did find work pretty easily. Of course at a big pay cut but still plenty enough to not get foreclosed on so off I went.
The work consisted of an endless string of 1-4 week contract jobs at banks all over the place. I traveled constantly. Newly married, nice home, and I was never there. But I paid the bills and survived. Was traveling for work fun? Yes, for about 2 months it was. But it got old. Really old. Sometimes I would be literally at DCA or BWI arriving on a Friday evening for a weekend home and I would get a call...plane to Dallas departs at 9pm and I'm on it. Ugh. There was no saying no so off I went. Another weekend missing married and home life.
I got used to travelling and I was making enough so all was good...until I find out my wife is pregnant...with twins...OMG now what am I going to do? I can't be gone 25 days a month? WTF am I going to do now? She was going to have to leave her job late in the pregnancy (twins are no joke) and I had to figure out how to stay home AND cover 2 incomes. Oh god...I was a mess. But I got lucky and got the sweetest 10 month contract gig @ HUD in DC. Back home AND paying the bills! But 10 months goes by fast...real fast...
So now I have 2 sets of twins (I married into a set of twins), big bills, one income, and a job that's ending...OMG now what am I going to do? So I'm at a party with a bunch of old friends and ran into an old friend of mine has been struggling to grow his mortgage brokerage. This is 2005 so mortgage biz is rockin. We struck a deal. I would come on as a minority partner and grow the business. We would split the profits. I was terrified in many ways and excited in others. And man was I focused. If we didn't make enough money I wasn't going to be able to cover the monthly nut.
Mortgage biz was great. We killed it. I really believed that I had found my final stopping point in life. I mean what could go wrong right? Established business, great employees, we became a mortgage banker and funded our own stuff, and the business didn't owe a penny of in debt. It was like a dream. All my life's problems solved...and then the credit crisis froze the banks and the real estate crisis froze demand for loans basically overnight. Poof. By late 2010 we let everybody go and called it a wrap.
This last "disaster" wasn't actually that bad. I was much older and much more experienced. Especially in the WTF am I going to do department. I didn't stress out. I didn't freak out. I just dug in deep again and made it happen. So did my wife. Yea, it sucked really bad during the recession but our pain was far from unique. It was a bloodbath everywhere. But oddly the least stressful of all previous disasters.
You just experienced your first WTF am I going to do moment in life and have recovered. It's not going to be your last. Each one is a building block towards future success. Look on the bright side. You're not married with kids and a big mortgage and all the other stuff. That WTF moment will come later. LOL
TL:DR - Congrats on the new gig and work hard and prosper!