One of the hardest thing for any writer to have to face is the marketing of their material. I don't claim to be an expert on the subject, if I did, I'd be on the bestseller list. All I can tell you is do what works for you. There are various social media sites that help spread the word, such as Facebook, Twitter,, Instagram, and Tumbler, just to name a few. Amazon offers ad campaigns on Kindle, depending if you're willing to let your books go for free or at a reduced cost. Facebook also offers ad campaigns as well, although I would recommend using these for events, instead of direct advertising. From my experience, Facebook ads do not sell books, but having readers know where you will be next does.
If you use a traditional publisher, marketing decisions are handled by them, but usually only for as long as the book is selling. Once it doesn't produce results, the marketing is left in your hands. Publishers sometimes discontinue books that aren't selling, and if you don't keep a back up copy to self publish, it could be difficult to get more copies. Traditional publishers are well experienced, however on what it takes to sell a book, and if your book is a good one, it should do well in the marketplace.
There are several websites, blogs, and entrepreneurs out there who claim to know how to teach you how to sell books. But beware, several will take your money, offering a system that may or may not work for you. If you believe that one of these systems may work for you, by all means go with it, but at least check the site out to see if it's legit or not. I did this with self publishers to make sure they were on the level. There is really no set formula for success; one works for one may not work for others. You have to go where you think your books will sell. I sell science fiction and fantasy, so Comic Cons are a good fit. If you write romance, craft shows and fairs are a good outlet. Sports related books do well at sporting events. You see where I'm getting at.
This concludes my self publishing series, which is meant to be an easy guide to understanding the writing process. For more in depth discussion, Amazon's Kindle Direct Publishing offers a step by step guide to the process. Good luck, and have fun creating!