First step of troubleshooting is to separate potential GarageBand issues with potential System issues.
Whenever you don't have any input signal in GarageBand (regardless what input, audio or MIDI), you have to check if your system receives the signal. If not, then the problem is not GarageBand.
Check your System Preferences Sound tab to see if OSX recognizes the input device (Mic, Line in, external interface) and if so see if you have an input signal (level meter in the System Preferences). MIDI is slighlty different but it is the same concept.
Only if OSX "sees" the audio device and you can see the signal on the System Preferences input meter, then you can move to GarageBand to check if it the signal "arrives" there.
If and so, and you checked everything in GarageBand and it is still not working, then use a different app (i.e. QuickTime Player) to see it you can record audio with that app. If that is the case, then you definately have a GarageBand issue and you can look into that further. For example, log in with a different user to rule out preferences file coruption.
As you can see, there are lots of checks you perform. Next time you run into that issue, try to find the problem and maybe you discovered a GarageBand bug after all. If so let us know.