This command downloads the legitimate 6.08GB DMG file directly to your "Downloads" folder.

: Inside the disk image, double-click the InstallMacOSX.pkg file.

Use this link directly from Apple:

: Requires OS X 10.6.8 (Snow Leopard) or later to perform an upgrade. Important Notes Getting Mac OS El Capitan in 2023?

: Open your Applications folder and double-click Install OS X El Capitan to begin the actual operating system installation or to create a bootable USB. Important Considerations OS X El Capitan - Technical Specifications - Apple Support

If you have previously "purchased" (downloaded) El Capitan using your Apple ID, it will appear in your tab in the App Store. However, this is increasingly rare for modern users to find. Creating a Bootable USB (The Pro Method)