My take on sizing:
Correct frame size
And fitting:
bike fitting
Apart from that: avoid suspension and disc brakes. Good ones cost a lot and are not necessary for a commuting/groceries.
Make sure the frame has room (and drilled holes for bolts) for a rear rack and mudguards.
An old rigid MTB is a good cheap choice, as well as most "city", or "hybrid" bikes, as long as they can take rack. Even a "road" bike with room for 28mm or wider tyres and bolts for mounting a rear rack is a good choice IMO.