If you’re trying to make it as a writer of fiction or nonfiction, you may find yourself frustrated at times. In fact, you’re virtually sure to, as writers face an incredible amount of adversity and rejection. They often toil in relative obscurity, relying on their own passion and work ethic to keep them going until maybe — just maybe — they make it big.

That can be tough, and it takes a lot of commitment to keep going. If you feel like you’re in need of a little bit of inspiration, here are four writers who made it big, and how they did it. You might be surprised to learn just how much rejection some of these writers faced, or just how many years they spent trying to write or committing themselves to other careers before they became successful writers.

Amanda Hocking

Amanda Hocking’s journey is a writing success story that helps illustrate just how dramatically the world of book publishing has changed in recent years. Like many writers, Hocking had an unpublished novel that she was desperate to see succeed. And, like many writers, Hocking needed money. So, back in 2010, Hocking put her unpublished novel up herself in Amazon’s Kindle store.

It was a smash hit. Hocking became a bestselling author without ever having to deal with a traditional publishing house. Her book sold 1.5 million digital copies in mere months, netting her a profit of $2.5 million.

Stephen King

Stephen King succeeded in writing at a relatively young age and became fabulously successful — but that doesn’t mean that he didn’t have plenty of struggles. After King graduated from the University of Maine, he got married and struggled to support his new family, working for a time in a laundromat. He later managed to secure a post as an English teacher, but it wasn’t until 1973 that he hit it big. King sold his first horror novel, Carrie, and the rest is history.

King built on his early success. Known for his work ethic and prolific output, King writes thousands of words per day and has published dozens of books, including nearly 60 novels. Plenty of authors have had a book published, few of those have turned an initial hit into a long-term career. King proves that authors can make it, but reminds us that great authors never stop working to build on what they’ve started.

Caesar Rondina

Caesar Rondina is now known as an author, but he spend the majority of his career in health care. He worked for 35 years in the public health care system, including 17 years handling highly stressful work as a paramedic. But he dreamed of being a writer, so he worked hard to make a transition in his career.

Rondina is proof that writers can come from diverse backgrounds and succeed in writing meaningful work later in their careers. Rondina’s books include crime fiction stories, love stories, and a memoir. He has hit the bestseller list, and now writes and works as a public speaker full-time.

J.K. Rowling

You’ve probably heart of J.K. Rowling. Her Harry Potter books were a phenomenon when they were first published, and they remain massively popular and well-respected. But J.K. Rowling wasn’t always worth $650 million. Rowling was a struggling single mother living in Scotland when she sat down to write the first Harry Potter book.

And her struggles didn’t end when she finished the book. The first Harry Potter novel was rejected by more than a dozen publishers before it found a home. By the time Rowling finished her seventh book, you can believe that the publishers that rejected Harry Potter were kicking themselves.

Becoming a successful author is incredibly tough, but it can be done. Your journey may take you in all sorts of directions, but if you keep trying, you’ll have your chance.