Hitchhiking is usually very safe. The most encountered feelings of unsafety are probably concerning the driver's driving style.
It is preferable to choose your drivers, i.e. to be at a gas station and to ask only the people with whom you would feel okay.
Keep stuff like money, phone, passport on your body, so that you still have that if you need to "abandon" the vehicle. Try to keep your bags close to you as well.
For women it might be a bit more risky. It is a good idea to get yourself some pepper spray, just in case.
The most important factors for safe travel while hitchhiking are road safety, awareness and communication.
The #1 danger to a hitchhiker is not violence; it is traffic accidents. As a result, hitchhikers should make sure they are standing along a safe portion of road, as far back from the traveled portion of the road as possible (on the unimproved portion of the road shoulder). Make sure that you are visible to drivers from a good distance (100 meters or more) to allow them time to safely pull to the side of the road.
Awareness on the part of a hitchhiker will keep him or her from accepting dangerous rides- for example, a driver traveling under the influence of alcohol or narcotics. Examine the driver and vehicle. If there are signs of intoxication (slurred or erratic speech, no eye contact, open alcohol containers) do NOT get in the vehicle. Refuse the ride.
Communication is essential to make sure the ride offered is one that the hitchhiker would like to take, and that it will end at a safe spot to stop. Ask the driver before getting in his/her car: Where are you going? Can you drop me off at a service area or other safe place near your destination? Trust your instincts. If you do not feel comfortable accepting the ride, thank the driver and say no. Walk away.