I usually only buy online if the store has a very detailed / accurate size chart for their clothes (some places have generic size charts where the actual clothes sizes don't necessarily match).
Then I measure my body with a tape measure, and for a new place I make a small order usually with two sizes, usually of something I wouldn't mind having both sizes for.
(As others have said, usually I order from places online that have easy return policies, e.g. pact allows me to bring the clothes to any Ulta store nearby and they have a little kiosk that handles the return for me.)
Usually I have to figure out the size for tops and bottoms relative to the place.
But in general I prefer to buy clothes in person and to try them on before deciding.