Some suggestions for hostels.
Hi, and Welcome to The Great American Road Trip forum.
Depending on your interests, you could head south to the mountains, or west to the cities. Given your age and your desire to have a safe place to stay, I would probably recommend the latter where hostels are more prolific.
In Sacramento the HI hostel is the most beautiful building in which I have ever slept. It is secure, friendly and located in the historic part of town. Of all the hostels available in San Francisco there are several HI hostels, and the USA hostel I would put top of the list. The benefit you will have at these hostels is that they are very good at organising budget tours to the local attractions, and even to places as far afield as Yosemite. These trips are always popular with young, first time and solo travellers. Be aware though, that rarely do hostels provide parking, and parking in SF can be expensive. Last time I was there, the hostel in Sacramento had parking available. There are many other hostels around these areas.
Some things about hostels. Check that the hostel at which you choose to stay provides a locker for each bed, in which you can place your valuables. Make sure it is a locker which can be locked with your own padlock. Carry a medium sized padlock with you. Lockers which are coin operated are accessible to management, and I do not regard them as 'secure'. Never stay at a hostel which permits guests to use their own sleeping bags. These are one of the main causes of bed bug infections. And always wear something on your feet in the bathroom, even in the shower. That goes for all public bathrooms, including hotels/motels.
Lifey