By sending a letter to your own address with a sound recording or the music score of your work. By means of the post stamp everyone can check when the work has been dispatched. Important: Do not open the letter because it is otherwise not clear how long the sound recording or the music score have been in the envelope.
Another means that can help to prove the authorship of a person is evidence given by witnesses, for example at a private performance. In the best-case scenario, the witnesses are no friends or relatives. Witnesses must be able to specify exactly when they heard the musical piece for the first time.
Of course, you can also keep your work at a lawyer or a notary. This does, however, entail costs.