What are they?
RAW is an uncompressed image, you can set a camera to take a picture in RAW format, which will produce an uncompressed image, when taking a picture in RAW ensure you have a large memory card inside the camera as they take up a fair amount of space per image.
JPEG is a compressed image, by default camera's use this, it is the most common format for image files, when you take a picture in JPEG rather than RAW you receive a compressed image before you even have done any editing!
Most camera will allow you to shoot in RAW and JPEG, meaning you will receive one uncompressed image and one compressed image.
What is the main difference between them?
The difference between them is that RAW is uncompressed pure image, so you get exactly what you see through the viewfinder, JPEG you receive a compressed file to save on file size.
When you edit an already compressed image and continue to compressed it even further the image will then start to distort and pixelate. Taking images in RAW you have the complete uncompressed version of the photograph.
Due to file size of RAW if you plan on using the image on the web you will have to compress it, It's not wise to use RAW images on a webpage because the length of time it will take for the image to load.
When you use RAW and then open the photograph in photoshop you automatically get to use the RAW editor, which allows you to change settings within the image until you get the picture you was hoping for.
This is the RAW Editor you can change all sorts in this to create the perfect image that you are looking for.
In this example you can see that I have change the vibrance of the image to make it more realistic, i've also exposed the image less, allowing less light in, meaning that glare from the sun hasn't cause a problem.
There isn't a set way to use the RAW editor just play with it until the picture suits.
You are able to do this with JPEG as well, however you will be editing and then saving a already compressed image. It's also quite time consuming doing this with a JPEG as you have to go to Image>Adjustments and then select which option you want, as where the RAW editor gives it all in one window.
You can shoot in RAW and JPEG which is handy if you are tethered to a computer the JPEG image will download a lot faster than what a RAW file would. So if you are tethered to a computer once you shoot the image, you are able to view the JPEG image on your screen more or less straight away. Using this method will allow you to see the image on a bigger screen.
How do I shoot in RAW?
This all comes down to the camera you are using, however you should be aware that different camera brands will save there RAW files in different formats, Canon save there images as a CR2 file, Nikon saves them as a NEF file and Samsung save there's SRW file. They are all the same thing however Photoshop won't open some files in the editor, but the camera manufacturer will have software.
Changing your camera settings to shoot in raw is simple you need to find the menu which looks similar to...