Film Noir is a style of movie popular during the 1940s and 1950s whereas criminals exist in a world of deep shadows and moral ambiguity. Literally, Noir translates from French as black and that is the essence of the thing. Darkness both figurative and literal is the nature of Noir and anyone who wants to create an example of the genre needs to embrace it in all of its forms.
It's a genre which has older roots still in the Pulps and Detective stories of the previous decades. The term "Private Eye" actually comes from the Pinkerton Detective Agency, which got its start in the Old West for example. Noir arose from the fading romanticism of Westerns to the cynicism of the Great Depression.
While critics would argue with me over the definition, I believe Noir isn't limited to crime pictures and is more a sensibility than a genre. Cyberpunk is, essentially, science fiction Noir. The Western can be Noir once stripped of all its romanticism. You could even, theoretically, create Medieval Noir though I can't think of any examples off the top of my head.
The first thing one should do when creating a Noir piece is to strip it of normal heroism. This is harder than it sounds because most writers naturally try to make their protagonists a little larger than life and admirable. Noir heroes, by nature, have to be either extremely flawed or bad people who just happen to better than the alternative.
Occasionally, an author may subvert this by creating an honest cop or hero figure but this morality has to be distinctly at odds with the way the world works. In Sin City, Hartigan is an honest cop in an over-the-top parody of a Noir city. His honesty and nobility result in horrific personal consequences for himself and others.
This doesn't mean that the story can be lacking in heroism period, it just is something that needs to be handled carefully. Noir protagonists are often motivated by greed, lust, anger, and revenge as much as higher motives. When they do something genuinely noble, it should be with great reluctance. Take Rick from Casablanca. The ending wouldn't be nearly so powerful if not for the fact he has adamantly resisted doing the right thing throughout the movie.
Moreover, the hero isn't just the person who is lacking in heroism. The entire world has been drained of brightness. The world is corrupt and there's no real hope of it getting better. The sense of decay and corruption afflicting not just the protagonists but everyone in the world is a major part of what makes Noir work.
Another quality that is depressing is that the victories are personal ones as opposed to societal ones. It's impossible to root our corruption in City Hall, but you might be able to save someone from being murdered by the Mayor's goon squad for example. The events of the Noir-themed Bladerunner have no impact on Replicant slavery but allow Decker to achieve a bittersweet victory.
Authors may or may not choose to make the bleakness of the setting an environmental one. Urban sprawl, endless rain, and nighttime are typical of Film Noir for a reason. I'd argue that the affect of Noir can be achieved with environments not normally associated with it as well.
Mad Max successfully manages to create a Post-Apocalypse Noir through the inherent banality of highways and their surrounding environments. Max Payne is a Noir video game set against the worst snowstorm in New York history. Amusingly, Los Angeles is a setting for many successful Noir because the glitz and sun of the region is a deliberate contrast against the sleaze underlying it.
Noir is a sensibility where there are no easy answers, endings are never completely happy, everyone is flawed, corruption is rampant, and mankind is never going to be any better than it already is. The trick is understanding this doesn't make life not worth living. Noir heroes continue to muddy through life, trying to find answers, even if they're not to be found.
Maybe it's why the genre is so successful. We've all felt like that from time to time.