Start with dimensions
A 4000px phone photo rarely needs to stay 4000px wide for an article, profile image or product card. Reducing pixel width often saves more bytes than pushing quality too low.
Choose a maximum width close to the final display size, then compress. This keeps detail where it matters and removes pixels users will not see.