It's a combination of mood and setting. The mood should be serious and the world should be harsh. Grimdark fantasy is kind of a subcategory where the world is completely hopeless as opposed to just being a bit harsh.
The most famous dark fantasy (or depending on who you ask grimdark) series that I can think of is The Witcher. You probably know a bit about about it but there really are no proper good guys. Just Geralt who at least cares enough to try sometimes
Another pretty well known (but kinda controversial) one is Goblin Slayer. This one has some... interesting ideas about goblins. It does do a decent job of making them a credible threat though and you can understand why the goblin slayer wants to make them extinct. An interesting thing about this one is that the characters don't have actual names. This makes them feel disposable to some extent and adds to the general feel of it