A melodica is free-reed instrument and is like a combination of an accordion and a harmonica. You can blow through an attached mouthpiece or an extended tube and play notes on the keyboard keys to produce sound. The reed that helps to produce the sound of the melodica is built into where the mouthpiece is connected and helps to create notes that are two or three octaves long. Just like a harmonic or any brass instrument, you need to clean out any spit or dust that enters into the instrument.
Press on the small button at the end of the keyboard of the melodica. This is the spit valve, and when you blow through the mouthpiece while holding down the button, you'll release most of the excess spit that has accumulated inside of your melodica.
Unscrew the mouthpiece. If you mouthpiece is plastic, you can simply wash it with soap and hot water. If you have an older model and the mouthpiece is made of brass, you should use a brass cleaner that you can find at your local music store.
Use a pipe cleaner to get all dirt, dust, spit, or other debris from the inside of your melodica. You have to be careful when sliding the pipe cleaner through the reed to not displace the reed. Moving the reed drastically could destroy the sound of your melodica.
Open up the melodica to clean inside it. Remember that each model of melodica is different. Some newer and cheaper models can open by unclipping snaps from all of the corners. However, many older models have screws.
Carefully unscrew all of the screws from all corners of the melodica. Thoroughly clean the parts using an anti-disinfectant and polisher. Once again, use a brass cleaner for any brass areas of the instrument.
Try not to clean the inside of the melodica unless you find it absolutely necessary. However, depending on the model, it may be easier to clean the inside by opening up the melodica rather than risk moving the reed with a pipe cleaner.