Record your music, whether by writing it down as sheet music or making a recording of it. This is technically all that needs to be done to secure a copyright. Registering your work with the Copyright Office isn't necessary, but does have certain advantages.
Register your copyright by submitting together in one envelope your completed application, filing fee and copy of the music you wish to copyright either in the form of sheet music or a recording to the Library of Congress Copyright Office. The copy of your music will be stored as a matter of public record.
Learn that by copyrighting your music through the Copyright Office, you gain the protection of the United States Customs Department from your work being imported illegally for someone else's gain. This falls under Intellectual Property Rights protection. The copyright owner must register their copyright with the U.S. Customs service.
Know that if you choose not to register your music, and you find someone else is profiting from it, you must register it with the Copyright Office before you can file a lawsuit. However, having your work registered before an infringement occurs entitles you to collect lawyer's fees and statutory damages, instead of just actual losses.