When you are trying out a bike for size, stand astride the frame with your feet flat on the ground. Ideally there should be around 1” of clearance between yourself and the bike for a racing bike, closer to 3” on a mountain bike. Remember also that the bigger the frame size, the longer the top tube will be. Your bike shop should be able to advise you on the right size frame for you. It’s worth trying out several sizes to be absolutely sure about what feels right.
If you’re female you may wish to try out a women-specific bike. These sometimes have ‘step-through’ frames or conventional cross-bar frames, but will usually have a shorter cross bar as many women have a shorter torso. Set up the saddle to the appropriate height and make sure the seattube is not at its maximum height nor right down against the frame.