Splitting into .h file

I was wondering how to Split a c++ program into .cc and .h file and how to make file to compile them