reading information from file /proc

im looking for the steps to write a c program which work as the command PS and i know that i should read the information from pseudo file /proc but i dont know how and any simple code to help me understanding that... thanx