While it is important to do the best job you can when you are at work. Don't let your job define you. It always hurts to be let go, but more often than not, the next job can be better than the one you were laid off from as was the case in your case.
Employers try to offer new employees more than they made before, so just changing jobs often produces a pay increase.
The one thing I do think is critically important is to accumulate 6 months of living expenses as quickly as you can. This "cushion" will provide you the time to weather most things that come your way.
Being laid off feels like rejection even when it isn't. Also, remember how you felt being laid off and if you are in a position where you have to lay someone else off someday, do so with empathy.