Unfortunately many people at some point in their careers will experience being laid off. I'm going through it at the moment and if it does happen to you, it will be ok and you will be ok - there are plenty more fish in the sea.
There will be a conversation or announcement - short and factual because no-one around the table relishes it and then that's the worst of it out of the way.
You'll get through it just fine. Once you know, you may want to lay low for a couple of days to be kind to yourself (and avoid doing or saying anything rash that you might regret) then hold your head up, leverage your network and brush up your resume and get some interview practice. I do believe that as one door closes, another will open and you'll get an opportunity to do incredible work somewhere else with new people.
Try not to get too spun up worrying as you are a lot stronger than you probably think.
Be well.
@nfn+1jbQWc3j put it perfectly.