Writing to Market means writing types of books that are known to sell well. For an author that means finding a genre, and preferably a sub-genre to target. Researching and familiarising yourself with the conventions and tropes of the genre, you have to stick closely to them. You have to fit in before you can stand out.
That includes the book cover, blurb and promotional material. Any book written to market has to look like it belongs on the shelf next to the best-sellers in that genre.
Standing out means putting enough of a twist on it to make it distinctive; marketable to the core audience of that genre. There has to be a unique selling point (the good old ‘USP’) to draw readers to your book and not the thousands of others crowding the market. Preferably a USP that is cool or intriguing enough to draw readers in, not just plain daft for the sake of being distinctive. ‘Conan the Bassett Hound’ is unlikely to cut it in the Swords and Sorcery category. Although it might if you’re pitching for the Terry Pratchett audience.
Beware the cross-genre mashup; you need to check that there is an actual market for Sword and Sorcery Cookery books before you write. Although these days, the well of sub-genres and crossovers is deeply mined. Pride and Prejudice and Zombies pretty well confirmed that.
Writing to Market doesn’t mean writing to a formula; although there’s a huge volume of books written that way. Heaps of pseudo-scientific book analyses detail every single plot and character element down to the protagonist’s inside-leg measurement. There’s fitting in and then there’s plain magnolia wallpaper. A book may conform to all the genre tropes and conventions, but if it’s by-the-numbers dull, it still won’t sell.
It’s worth looking at the fashion industry and Wall street to remind yourself the Market can be a fickle mistress.