At times when you're trying to get published it can feel like you're standing outside a shop where the closed sign has gone up and then they pull down the shutters when they see you coming.
It's tough going but there are some things you can do to give yourself a fighting chance -
Read as much as you can and in as many genres as you can. Whenever I'm stuck with a bit in my novel, reading inspires me.
Write as much as you can and accept that you may have to write a lot of novels or non-fiction books before you get published. This may be because your first work is rubbish/not what they're publishing right now/needed more work that you realised. I wrote 4 full sized novels before I had my novella accepted by Pulp Press. I also started many more.
Accept you will have some near misses. The man who discovered JK Rowling was interested in my non-fiction book but it came to nothing. The publisher of my first ever published book, a humour title wanted my next two books, but then they decided to cut back on their publishing schedule and they couldn't do the 2 books.
Don't be snooty about any other genre. This is important because you might be missing out on the genre your writing might be most suited for.
Get to know other writers so you can share your tales of woe and success. Yes, I did say success. My favourite writers' forum is Talkback. Great people who are so supportive and know what it's like to be a writer.
Keep on submitting to publishers and agents and ALWAYS follow their guidelines. If you don't you might as well throw your submission in the bin. For instance, most agents & publishers don't want to see your full manuscript they may want to see 10,000 words or their first 3 chapters and a synopsis.
Get feedback on your work wherever you can. It's so difficult to see your work as others see it. If you can't get feedback edit your work by printing it out or viewing it on an ebook reader. It helps you to get your editor's hat on.
P.S. After writing this, I got the first rejection for my zombie book. Off to cry into a bucket then I’ll give myself a kick up the backside and get on with it. Writers who get published get published because they NEVER give up.