What model Mac/year do you have?
Do you know if you are in recovery (Cmd + r (Apple logo before you get the Mac Utilities)) or internet recovery (cmd + option + r (globe logo before you get the Mac Utilities))?
Do you have a backup you can use to restore your system?
To download El Capitan outside of the Recovery Mac Utilities you need access to the App Store. Do you have another Mac?
See step 4 "Get El Capitan" (the Mac must be capable of running El Capitan and not have Mojave already installed to download): https://support.apple.com/en-gb/HT206886
Then make a USB boot installer: https://support.apple.com/en-us/HT201372