The ideal situation with any meal is to take the insulin far enough in advance so that the insulin is peaking at about the same time as the food. Of course, that's easier said than done and it does vary from person to person and even between different meals for the same person. I need a 60 minute prebolus time for breakfast and about 30 minutes for dinner. I'm fortunate to use a CGM so I can watch my BG trace closely after I take a dose.
The only way to know how your personal metabolism works is to experiment, probably at home, when you have your safety carbs at hand, and can plate a meal quickly if needed. Take your meal insulin and then fingerstick frequently enough to hopefully you catch where to BG starts to drop.
For the restaurant situation that you presented, entre, main, dessert, you may want to consider dosing in three steps as well. The biggest problem and risk for we people with diabetes is the vagaries of restaurant service time. If you dose too early and the service is slow then you're in trouble and can take the enjoyment out.
Another tactic is to dose 2/3 of what you think you'll need for the meal and then deliver the last 1/3 when the food shows up. Trial and error and keeping some records should help you solve this challenge over time.