Seattle is a major city, and as when traveling to any other major city, one should take all of the safety precautions one would anywhere else. Statistically, Seattle is a relatively safe city, compared to similar sized peer cities in the US. Keep note of your belongings, make sure your wallet or purse is not too easy to access, lock belongings in the trunk of your car, do not leave valuables visible in the backseat, etc.  

Seattle does have its fair share of homeless and street people but in general they will not be a threat to your safety. In comparison with other west coast cities, the Seattle homeless population is less than San Francisco and likely more than Portland.  During the day, the downtown area is safe and popular areas such as Pioneer SquareDenny Regrade, Pike Place Market, Seattle Center are usually populated with people.  

Even after dark, most areas a visitor would likely find themselves in are safe with normal precautions. At night, use common sense.  Stay in lighted areas.  Try to be around other, sober people.  Be aware of your surroundings.   Seattle Police are routinely on downtown bicycle patrols (day and night) so the tourist areas of downtown (3rd to I-5; Stewart to Cherry) are safe at night.  Pioneer Square and Belltown are known for their bars and clubs; visitors should exercise a little more caution late at night in those areas, as well as in the International District.

The University District and Broadway are both magnets for homeless youth who can be intimidating but generally cause no harm.  Outside of these denser areas, Seattle is a fairly suburban, single-family home kind of city and most other neighborhoods are generally quite safe.

With regular, common sense precautions, a visit to Seattle is safe and enjoyable. While in every city there are incidents of crime, it is highly unlikely that you will experience anything related to that realm. Keep your valuables out of sight, keep situational awareness about the people that are around you, and enjoy Seattle.