There is no magic formula that will get you published. It's hard work and can take a long time. Study, do market research, hone your writing skills. Learn to do professional query letters, synopses, and book proposals. Subscribe to the Writer's Market. Join a writers' group. Go to conferences and meet writers, agents, and editors. Learn to sell yourself and your work.