Well, the first key is simply to make the site *good* as described in my article 'Tips for making a better website or blog". Also, for SEO (Search Engine Optimization) remember that some basic things help! Frequently updated websites, with an influx of new content will rank higher. Sites with lots of visitors who stick around a while, rank higher. Sites with links using text are more search engine readable, shops with SSL security are considered safer and rank higher, and sites with real backlinks - other sites linking to your site - rank well too. Finally, make it a point to fill in the title and description meta tags on your webpages. These snippets of text are what show up as the text in search results so you want them to be clearly descriptive summary of the page content. SEO is great as it can bring in some free traffic from people who are searching for the subject of your website.

But let's say you've got a good site and, even with optimization and great content, and search friendly design, still nobody knows it exists.

Here are some ways to approach the issue.

Become an active forum member, a regular in a community related to the website you run. I imagine you had a reason for the website you made. It was probably about something you liked, right? Chances are some community out there is interested in the same topic. So become a member of that group and communicate in a friendly way with them, engaging in their conversations. And while it shouldn't just be spamming, there's no reason you can't place a link to your website in your forum signature!

Search for the phrases that you think are relevant to your website, phrases that your potential audience would be likely to search for. Odds are, there's a blog on the topic somewhere on the first page of results. Try commenting on that blog post, not overtly spammy, but again, friendly, helpful, mentioning your website in terms of how its content is directly relevant to the conversation.

Simple. Tell the people you know about the site. Encourage them to take a look at it. If you have something awesome on your site, it's even likely they may share it and it could spread virally. Good content really is key - it matters more to a site's popularity than any other factor. 
It's also smart to integrate social networks into your site. I certainly did! You can see the Twitter, Facebook, YouTube, and Pinterest 'follow' links on this site, there's an entire section of the site dedicated to 'social media'. Be active enough in posting cool stuff about your website on your social media feeds that maybe people will 'like' and 'share' those posts. Again, things that people like, will probably go viral, spreading outwards, and the best place for that to happen is on social media.

You can advertise on Google with AdWords or on Facebook or Twitter or other big ad networks like Bing. It's not that expensive to start out - you can commit with just $5 - $10 to start on some of these. 
For a long time I really liked 'Project Wonderful' also, and got great results from it, but sadly it is now defunct.

Remember here that you want to give people a good reason to click on your ad. Make it flashy and focused - keep wording simple, terse, and focused on the viewer who knows nothing about your site. Tell them in a handful of words, why they should visit. Why they should want to visit your site. Make the ad flashy, with vivid colors, strong contrast, and some animation if possible, because people notice motion and strong colors. Warm colors like orange and red are especially effective in my experience, try to make the ad look attention-grabbing but not in a tacky, kitschy or 'flashing strobe animation' way. I have had an ad that has a couple of images of my artworks and says "99 CENT HANDMADE ART" and another which similarly says "AMAZING, AFFORDABLE ART". And it's not even misleading, because at the time I DID have some auctions that start at $0.99, and people HAVE in many cases managed to win auctions at that price. Don't mislead or lie with ads, but do emphasize your best stuff. Focus on what people like most about your site, and boil your message down to that. A button at the end saying directly, 'CLICK NOW' is also effective. People might need a final prod to actually do something, and not move elsewhere, so make it totally, directly clear what you want them to do and that they should do it NOW. It isn't enough for them to like how your ad looks. They should be compelled, convinced to interact by clicking it. By the way, I know what I'm talking about. I've gotten high click counts - about 2.4% of people who see banners advertising my sites, actually click them. So I must be doing something right, especially considering that average click rates in this industry are a fraction of one percent.
Ads on and other websites run by Matthew Hornbostel, include banner ads from Comic Ad Network [top ad - an unfiltered banner rotation system predominantly used by web comics, art sites, but occasionally some questionable items.] and my own banner rotation system [bottom - anything here is either my own stuff like websites, online shops, or social media profiles, or has been vetted by me and found to be generally legit. I have several cashback sites [all of them are ones I've used and cashed out tens of $ from successfully already] and major online retail stores [Sony, Microsoft, Amazon...] in that mix. Usually they give me some sort of small compensation if you buy from them through the link, which I'm disclosing right now. They're all legit spots, but if skeptical do your own research before committing to anything.]