The mistake with white shorts is assuming any white will do, then standing in daylight and realising the fabric is thin enough to show exactly what's underneath. White hides nothing. It shows seams, pocket bags, the outline of anything you're wearing beneath, and it shows them more the moment you move into proper sun rather than shop lighting.
Not every white is the same white, and that matters more here than with almost any other colour. A warm, slightly off white or ecru is far easier to live with than a stark, bright white, because it forgives the inevitable slight unevenness in fabric and doesn't scream if it's a shade different from your top. True white looks brilliant against tanned or deep skin and can look a bit clinical against paler skin, so it's worth holding a pair up to your face before you commit. For the fit, go up a size from what you'd usually take in a dark colour if the fabric has any stretch at all, because white shows every pull across the hip and thigh that a navy or black pair would quietly absorb. Check the rise sitting down as well as standing, since that's when a too low rise on white becomes a problem rather than just a look. Watch for shorts that gap at the waistband when you bend, and for any seam that sits directly over the fullest part of your thigh, because on white that line will show as a shadow all day.
If you've got none, start with a tailored, slightly structured pair in a mid weight cotton or cotton blend, rather than anything linen or very lightweight. Linen creases if you look at it and shows every crease in white specifically, which is charming for about ten minutes and then just looks unmade. A pair with some structure holds its shape through a day of sitting, walking and getting in and out of a car, and a slightly longer leg, around mid thigh, gives you room to move without worrying about flashing anything underneath. Pair that first pair with a lining, proper opaque lining, not just a facing at the front.
The difference between a good pair and a disappointing one is mostly in your hands before you've even tried them on. Hold the fabric up to a window or a bright light. If you can see your hand clearly through it, it needs a slip underneath or it isn't the one. Check the waistband is fully lined too, not just the body, because an unlined waistband goes see through first and fastest. Look at the stitching on the pockets and fly for any puckering, and check the hardware, the button and zip, isn't the kind that leaves a rust mark the first time it gets caught in rain. Reach for white shorts on a hot, bright day when you want something that looks deliberate rather than thrown on, not on a day you'll be sitting on grass.