Resources for renters abound at the San Francisco Rent Board, the San Francisco Tenants Union, and the Eviction Defense Collaborative. There are also legal service groups for specific communities, including roommates (the Housing Rights Committee of SF), gay and HIV-positive folks (the AIDS Housing Alliance), Spanish speakers, and elders and disabled people (Legal Assistance for the Elderly).
You can also take on the whole housing system with the direct action group Eviction Free San Francisco or even team up with your pals to buy a place of your own. The San Francisco Community Land Trust is dedicated to helping low- and mid-income folks secure permanent, affordable housing through community land ownership.