Most people correctly understand that God is love. They then reason that out of love, he will unquestionably accept them as they are, welcoming them into heaven when they die. This is an oversimplification of his love.
God is also just. His just nature requires that there be a punishment for the wrong things that we do.
If, out of love, God didn’t require punishment for wrongdoing, that would make him unjust. Lacking justice and being unfair is unloving. Therefore, he must punish wrong living. That punishment was taken on by Jesus (if we accept it); otherwise we must face the punishment ourselves.
So God’s just nature requires punishment, but his loving nature covers that punishment through Jesus.