With great difficulty or considerable ease is the answer. Some titles can come instantly, almost the moment the novel hits the page (or rather the computer screen) Dead Man's Wharf was one such case. Others are like pregnancy, taking months to develop and even when the novel is finished I might still have no idea for a suitable title. A bit like the Horton novel I'm currently working on.
It doesn’t matter when the title comes to me though, what does is that it must suit the novel, and if possible be memorable, although in my experience people rarely remember the title of a novel unless it's been made into a film or a television series. Occasionally the Publisher will help with the title, or can suggest changing it to one they think more appealing or suitable. And titles are often changed in translation to suit the country, and sometimes even when it is an English speaking country but with different spellings of a word. For example, Deadly Waters started out as Deadly Harbour but was changed because of publication in America where 'harbour' is spelt 'harbor.'
There are many different types of crime novel so equally there are many different types of crime novel titles. The title needs to reflect the mood of the book, as well as its structure and tone.
The Suffocating Sea conjures up the body on the burning boat in a marina on a foggy November night and how Horton feels as the novel progresses and he begins to discover some uncomfortable things about his mother's past.
Tide of Death represents the body washed up on the tide and how one death triggers a series as the killer gets more and more desperate to cover his tracks. And Blood on the Sand, reflects the bloody body found in the sand of a bunker on an abandoned golf course on the Isle of Wight. With the Horton marine mystery crime novels I try to add a ‘sea’ element to the title. The stand alone thrillers are slightly different.
Even though these too are set against the backdrop of the sea it wasn't so essential to reflect this in the title. In For The Kill was a title that sprang instantly to mind as Alex Albury will fight to the bitter end to expose the man who stole his identity, framed him and destroyed his comfortable life and reputation. He is out to kill or be killed.
In Cold Daylight started out as The Cold Light of Day. The title represents the fact that Adam Greene, the reluctant hero, emerges from the story a different man than when he started. His journey forces him to relive past traumas and face up to the shame of his mental breakdown on a quest that was forced upon him to discover the truth behind the death of his friend, fire-fighter Jack Bartholomew and several of his colleagues of cancer.
Titles do matter because people can choose a book because of its title, and the look of the cover, especially if it is a new author for them, and one that hasn't necessarily been recommended by someone. So titles need to be easy to say and remember, not too long either otherwise they will look odd on the cover and spine, they must also reflect the genre, and the sector within that genre i.e. cozy, gritty, noir, historical etc. And if the book becomes a treasured one then the title will stick, even if the name of the author has been forgotten.