There is absolutely no right way of doing this so do what seems best to you. That probably applies to mostly everything, although I would suggest that your medical team is one thing you should listen to carefully.
I didn't want to tell my daughter till I knew for sure, no point in spreading the worry (I was still hopeful it was all a terrible mistake). Recognising that cancer can happen to you takes time. One of the hardest things is that some of the business seems all very fast and you are left breathless and confused, and some of it (including coming to terms with a changed reality) takes ages. You finally have to just live with that, it's the way it is. Breathe and be assured that once you know what you are facing, it becomes a bit easier. You can focus on what you need to do and that actually helps. This is a good place to talk, nothing is not worth talking about, and it's also a good place to say the things that you may not want to say to those closer to you - whether it's feeling angry, sad or seeing the funny side (there can be one!). Best wishes.