Install El Capitan from usb drive
If you already have an older version of OS X installed on your iMac just go to the App Store, search for El Capitan and click install. It will update to the latest version and your data will stay on the iMac.

If you don't have an OS installed on the iMac, but have a Time Machine backup of your data, just boot from the El Capitan USB stick and do a fresh install. At the beginning of the process it will ask you if you want to transfer your old data from a Time Machine backup. Use that option and it will create a new OS X installation with your old data in place.

If you don't have any OS installed on the Mac (but still have data on it) and no external backup of your data, then you should first create such a backup to an external drive, then install El Capitan using the USB stick and then copy the data back from your external backup to your iMac.

If you have a copy of your data on your Macbook, you could also transfer everything using a direct connection cable between the iMac and the Macbook. Read here how to do it: https://support.apple.com/en-us/HT204350