To do it very simply with an iPhone or similar digital camera. Your subject needs to be inbetween the camera and the light source.
If using something like an iPhone you may need to tap the background or light source in your viewfinder to ensure the camera focuses on the right part if the picture
When the background or light source is in focus
When the foreground or subject is in focus
Taken using the sun as a light source
Setting sun/light source is being blocked out by subject making an effective silhouette