Look on the back of your keyboard. You will see input and output ports.
Hook your cord into the output port of your keyboard. Your keyboard should have either a USB port or a MIDI port. To make things easier, you'll want to see if your computer has one of these ports as well. If they have the same one you'll save yourself time trying to find adapters to fit different inputs.
Hook the cord from the output of your keyboard into an input on your computer.
Open your computer's recording software. Most computers come standard with some sort of recording software. Most Macs come with GarageBand and most PCs will come with some Windows sound recording software.
Select the option that will allow you to record from an external source. On GarageBand you will have to click "Add a Real Instrument."
Make music. At this point, hook up your keyboard and record your music.
Save the file. With most programs you'll have to save your song to your computer before you can export it.
Burn the CD. Most recording programs will have a function under the "File" option that will say "Export." Select the "Export" function and then designate that you want the file sent to your CD drive. If you don't see an "Export" option, try looking under the "Save As" function. If you're using GarageBand on a Mac, click the "Share" option and then "Export Song to Disc."