You do inflo/ outflow modelling over the completion's design life, using estimates of the PI, water cut and reservoir pressure over the completion's design life to come up with a tubing size.
You then check that the tubing you've chosen can fit inside the casing you've got (or perhaps, if you're in an enlightened company, you're designing the well around the completion). Avoid the common mistake of forgetting that SSSCV's a lot bigger than the tubing. Then you do a tubing stress analysis to check the wall thickness, material and connection type.
Casing sizes are often driven by the number of casing points needed to drill the well, the desired completion size ane things like the rig's BOP size or the wellhead size (in subsea wells, the biggest casing size is usually 30" as that's what fits through the guide base). Ideally you start at eh bottom and work up, but often you start at the top and work down. Casing wall thickness is then driven by the casing stress analysis: 47ppf is the usual thickness for 9-5/8", but 53.5ppf may be specified if you need more strength due to mobile formations like salt, or you've got ESPs which have a high drawdown or it's an HPHT well. the casing stress will also tell you if you need premium connections. Which conenction is often due to what commonly vailable in a particular area: so in the North Sea VAM's conenctions (new VAM, VAM top etc) are used, but in the States Hunting have a greater share of the market