How does one optimize images so they can be uploaded to a group gallery?

Im trying to upload sone cool images to the gallery of a group I run but they either exceed the pixel constraints or file size constraints. Is there a method or tool to use to optimize images and make them fit these criteria? I’d really hate for those images to go to waste. Any help or advice is appreciated, thank you in advance.

If you have Photoshop, you can adjust the image size and resolution by going to
Image > Image Size.

If you don’t have Photoshop, you can use a free web-based version like photopea

in photopia drag your image in then press, File > Export As. then you can adjust the file size and quality before pressing save.

if you don’t want to do either you can search for image resizer or image compressor in your browser.