As far as I know, they are used for different purposes (.c and .h).
Here, I've found this over the internet (about libraries and headers):
Think of both like this (Disclaimer: this is a really high-level analogy
..
The header is a phone number you can call, while...
...the library is the actual person you can reach there!
It's the fundamental difference between "interface" and "implementation"; the interface (header) tells you how to call some functionality (without knowing how it works), while the implementation (library) is the actual functionality.
As far as I know, header file could help you to avoid 'undeclared function' issues, if you use function which is placed under the one that calls it, f.e.:
void callFunction(){
makeBeep();
}
void makeBeep(){
beep();
}
You can declare that 'makeBeep()' in the header file, so the whole .c file will 'know' the list of available functions (variables etc).
I might be wrong, but this is how I see it so far.
Best regards