My first attempts at getting published were reasonably successful. I targetted some religious publications and produced several articles which were accepted and paid for. I tried to follow the advice which seems to be given in all books about writing for profit - choose the people and places that you will approach with ideas and written materials very carefully. Do not waste time by writing to publishers who have nothing to do with the subject area that you want to be writing about. I have continued to write for a variety of magazines and journals, and it is certainly the case that if you can gain a reputation for producing readable material to a deadline then your ideas and suggestions for other articles are likely to be taken seriously.
I have also sent off a few draft chapters and ideas for full length books. Some of these have been turned down, but my last effort received a warm-ish reply and the suggestion that I go ahead and write the book. At the time it was impossible for me to do so to the very tight deadline they proposed. But they did chase me up the following year and ask if I was still interested. This certainly gave me the confidence to believe that my sample writing was of a professional standard, and that my ideas, and the manner in which I presented them, were at least worth a traditional publisher taking some time to consider.
But in the end I have not chosen to take the traditional route to seeing a full length book published. I have chosen to self publish.