This sounds like you probably have had several episodes of laryngitis. Laryngitis is simple a fancy medical word for 'inflammation of the voice box.'
The most common cause of laryngitis is mechanical strain on the vocal cords. This is common in people who sing, but it could also conceivably occur after any episode in which you where shouting or using your voice at louder volumes for a long period of time. This mechanical strain is just like any other overuse
injury of any other muscle in the body; it gets better on its own with rest!
The second most common cause of laryngitis is a viral infection. The viruses which can cause laryngitis are essentially the same viruses which cause the common cold. If your 'losing your voice' developed in this context (as it sounds like it did at least once) then this is what is going on; again, once the cold wears off, the laryngitis will go away without any ill effects.
As long as your voice returns completely to normal between these episodes, you probably don't need to see a specialist. However, if you feel like you are chronically hoarse, then you should see an ear, nose and throat (ENT)
doctor for further evaluation.