Resize first — it is usually the whole answer
A photograph straight from a phone is often 4000 pixels wide. Displayed in a 800-pixel column, seven eighths of that detail is discarded by the browser on every view, having been downloaded first. Resizing to the width it will actually be shown at typically cuts the file by 80–90% before any quality is lost at all.
Compression is what you do after that, to trim the remainder. Doing it the other way round — compressing a 4000-pixel image hard to hit a size target, then displaying it small — produces a visibly worse result at the same number of bytes, because the artefacts were baked in at full resolution and then scaled down with the image.