Many atheists love to point to certain violent passages in the Old Testament and say "See! Your God is extremely violent! How could you worship such a God?" In these situations, the atheist really isn't thinking rationally. Yes, many of God's judgements in the past have been violent, but this does not make Him evil. Consider the following points:
1) This reasoning is circular.
If God exists, it is literally impossible for Him to do wrong. He is the standard of morality, and thus anything He does, or anything He commands, is good by definition. That includes how He judges those who disobey Him. If you look at God's judgements and say "that's evil", you are automatically assuming that He doesn't exist. And yet this is the very point they are trying to prove! The atheist is trying to prove God doesn't exist by assuming God does not exist. This is no better than if a Christian says "the Bible is the word of God because God says it is His word in the Bible."
2) This reasoning is arrogant.
On top of being circular by assuming a higher moral standard than God to prove there is a higher standard of morality than God, the "higher standard" is usually the atheist themselves. They judge God as evil because they don't like God's judgements. Effectively, they are asking you to replace God with them.
3) This reasoning is clearly motivated.
The real reason atheists hate the judgements of God is not because God's judgement is unjust, but because it is just. No criminal ever wants to face the just punishment of his crime. The whole point of punishment is to be hated. The whole point of God's visible judgements in the Old Testament record were not only justified punishments against those who suffered them, but they also serve as a warning to impenitent sinners in the future. But obviously, atheists don't want to heed that warning. They prefer their sin over the God who offers them forgiveness, but that does mean they will receive judgement eventually. Who will support a punishment being levied upon a sinner when you, yourself, are worthy of that same punishment?
4) This reasoning is groundless.
Without God, there is no such thing as "good" and "evil". As Richard Dawkins, an ironic proponent of the "evil God" argument, once put it, nature shows only "blind, pitiless indifference". And he's right. Does acid care what it dissolves? Does water care what it erodes? Does fire care what it burns? Even animals don't show much emotion when they steal, rape, or kill. Thus, when an atheist calls anything evil, they are admitting something divine in humans. Something that makes us morally accountable. Who to? God. But if we're accountable to God, how can God possibly be accountable to us? We don't get to judge Him for punishing sinners, He judges us for committing the sin.
But there is an alternative. The coin on which we find God's wrath has another side. Mercy and grace are His preference. Ezekiel 33:11 tells us God has no pleasure in the death of the wicked, but prefers we repent. 2 Peter 3:9 tells us He is not willing that any should perish. God doesn't want to kill sinners! God wants to grant every last one of us eternal life. But that requires us to get off our high horses. And so the only logical response to "I don't know how you could worship such a violent God" is "I don't know how you don't worship such a gracious God".
God is too Holy to let any sin go unpunished. All sin must be dealt with, and unfortunately, that involves death. But it doesn't have to be the sinner's death. Jesus, being sinless, is worthy to take the full wrath of God upon Himself via the cross. When Jesus died, every sin was dealt with. Now, all we need to do is come to Him in faith, and we will never see the wrath of God. Our lives on the earth will end, and we will inherit eternal life with Him in His kingdom. Where is the sanity in choosing an eternity in a lake of fire over that?