Yeah, it’s easy to misunderstand God as mean or unrighteous when reading the OT, but that’s a result of not understanding the context and the gravity of sin. The more we understand the context and realise how fallen we are, the more we start to see God’s love, grace, and long-suffering.
God always calls us to repentance and faith, and the God of the OT is the same God that is Jesus. So to rightly understand the OT, we should understand it through the NT, just as we understand the NT through the OT. It’s not as if God is angry in the OT and all mellow in the NT. God is the same forever — He is good, holy, merciful, and righteous.