How to use Proximity

Can you show me an example of using proximity sensor , i need to know the syntax of using it because its the first time for me, or a link of Documentation .
Thank you in advice.