Cozy novels do not have graphic violence, and little or no sexual content and abusive language. Society is "viewed as orderly and controlled, and the crime is a failure of the society to function correctly" (Niebuhr 7). In this type of novel, right and wrong are clearly defined, and the murder is considered to be an aberration, not something that is seen on a daily basis.
The detective in these novels is usually an amateur, although there are exceptions such as Agatha Christie's Superintendent Battle of the CID. And the murder victim tends to have some inherent moral flaw that leads to his or her death. This doesn't mean that the murder victim must be a monster. Take, for example, the character of Mrs. Argyle in Christie's Ordeal by Innocence. She was a wonderfully kind woman who turned her home into a safe haven for children during World War II. After the war ended, she adopted five of the children. She loved and cared for her adopted sons and daughters very much and did everthing she could for them.
Everyone spoke highly of her...but she ended up murdered. Her moral flaw - she was too arrogant in believing she knew the best for everyone around her. She was never cruel to anyone, at least outwardly, but she made her entire family dependent upon her...financially and emotionally. They all felt imprisoned by Mrs. Argyle, and so she died.
In cozy mysteries, there are no innocent victims. In one way or another, the murdered person contributed to his or her own death. It might be nothing more than a lack of judgment in trusting the wrong person, but there must be some kind of character flaw.
For that reason, children should not be used as victims...usually. As with any rule, there are exceptions. If you do use a child as a victim, make sure it is not brutal and it'd help if the child could not be thought of as "innocent." An example is Marlene, in the novel Hallow'en Party. Marlene, at the tender age of fourteen, was already an established blackmailer.
At the conclusion of cozy mysteries, the murderer is brought to justice and society returns to its orderly and controlled ways.
In hard-boiled novels, the detective is a professional, working for some law enforcement agency. The action is fast-paced, and includes graphic violence, sexual content, and adult language. This type of world is "a society where everything is suspect, including established institutions and the people who work for them - even the legal forces" (Niebuhr 7).
The detective-protagonist in these novels can be morally ambivalent, and can include characters whose actions are driven by circumstances out of their control. Morality is not black and white in the hard-boiled world, and justice isn't an inevitable expectation in these novels.
The setting of your novel has much to do with what type of mystery your readers will expect. For hard-boiled novels large, metropolitan cities are usual. It would be incongruous to set a cozy in someplace like Miami, for example.
Cozy mysteries tend to be placed in a small, restricted society. Even if set in some large city, such as New York, you should make it obvious that the perpetrator of the crime could only have been committed by a few individuals, say, guests at a posh dinner party.