To optimize images and media files on a WordPress site, resize and compress images before uploading, consider lazy loading images, and use plugins like WP Smush and EWWW Image Optimizer to automate the optimization process.