Write for whatever purpose God has called you to write.
He isn’t necessarily going to use us all the same way. Some might be called to reach outsiders. Others might be called to write for the Church. Some might even be simply called to represent our Lord well by writing excellent, top-notch entertainment.
That is going to be the best place to start as you’re praying and seeking guidance from the Lord. If he gives you a specific ministry focus for your fiction, that will layer on top of the basic of writing a well-crafted story. And it will be an extra level of challenge to do it while, say, exploring themes that (subtly or explicitly) challenge the Church and/or outsiders to reconsider worldly views and nudge them toward Biblical truth.
Not everyone’s up for such a task. It’s okay if you’re not. That doesn’t mean God can’t use you. He will, just another way.
Whatever you write, for whatever mortal audience, write it as unto the Lord. Follow God’s leading, obey the individual convictions and directions he gives you.
With gritty stuff, a general rule of thumb is: don’t glorify sin. Be as tasteful as possible without sacrificing story. Avoid also pretending there isn’t pleasure in sin for a season. Do be redemptive but without forcing it.