I tried to write who I know. I'm a classically-trained violinist and I like to arrange and compose, so my sleuth was a musician. I made her a composer and conductor with thoughts of injecting my own compositions into the mix somewhere--mixed media and all that. The brilliance amazed me. She could travel the world guest conducting and thus avoid Cabot Cove Syndrome. I envisioned this as a cozyish series and wrote two novels which got rejected, over and over.
Next, I followed a passion of mine, archeology and human origins. New discoveries are still being made almost weekly about Neanderthals, so I created a tribe and a sleuth and labored long and hard on one and a half mysteries for them. The first was well received by almost everyone except the agents, some of whom liked the manuscript, but said they didn't know how to sell it. Since I consider that their job, I couldn't scream: Send it to Scholastic!!! (Rowling's publisher)
Third, comedy. I've always considered writing comedy a cop-out because it's so easy. I found out that it's not easy for everyone, which was really a surprise. So I ran with it--past the boundaries of where I thought I should go, over the top with characters and situations, and--behold!--got it published!
If only they sold lotto tickets where all the numbers were three!
Do you have a magic number? If so, what's it done for you?