at first you must learn and understand the basic of C and multi-threading is an advanced theme. Looks like
soome pthread tutorial.
You can imagine it as some persons are in the kitchen and are cooking together. The biggest problem is to explain them how the understand each other and have to wait for each other in some form.