To protect your music you need to copyright it. Fortunately, music is automatically copyrighted when you put it into a tangible form, such as writing it out on paper or making an audio recording. Then you own the copyright and are protected by law so others cannot use your song without your permission.
However, if you want to be extra careful, you can register your works with the Copyright Office. If you do, you will have legal evidence that you were the first to create the work, which could save you a lot of headaches and money if you have to prove that you are the original author. It also means that the other side in a dispute bears the burden to prove that the work is not yours.
Here are some references to check out: