While the scripture reference isn't from the King James translation that I have, I know that this principle is true. While God might not necessarily cause a person pain, he will not leave us alone -- if something (or someone) hurts us, or is taken from us, he'll give us something better. He tells us that he desires happiness for each of his children, that this is his "work and my glory, to bring to pass the immortality and eternal life of man" (Moses 1:39) for "men are, that they might have joy" (2 Nephi 2:25).
I'll admit it. Sometimes life just sucks. Joy seems like something you find in a movie or a book, fabricated and written in such a way that everything works out perfectly. That isn't how real life is though. I'm sure everyone knows this. Things happen. We lose things or we can't make something work -- games, jobs, scholarships, friendships, relationships -- and we don't know why.
In the Bible, Job said that sometimes the Lord "taketh away, who can hinder him?" (Job 9:12). We often don't know why things get "taken away" from us, or why we're experiencing the things we are. Usually these are things that are out of our control. We didn't mean to lose something, and mean for it to be taken away or fall apart. But you know what? Sometimes, God removes things from our lives to give us something better. He knows best what will make us happy -- maybe that means taking away someone you thought would be in your life forever. Maybe that means God stepping aside just enough for you to get hurt, allowing you to see that the person or thing isn't good for you. Or maybe sometimes, things just happen and there isn't really a reason for it -- however, God can take any situation, even one that just happens, and use it to teach us and help us grow. In the end, we'll be happy.
The Lord doesn't leave us to do it alone. Even though things hurt and people do stupid things or manipulate you or you find yourself alone, you're not alone. Sometimes we don't know why things are happening to us. Sometimes there isn't a good reason. You may feel like you're drowning in emotions. You may feel betrayed, lost, broken, hopeless, helpless, alone, afraid, and you have no idea how to get out of it. It could be caused by a person, or by a circumstance, or by your own mind. But the Lord has promised you that if you do as he asks, he won't leave you alone. This promise is in Doctrine and Covenants 82:10, where God says "I, the Lord, am bound when ye do what I say." He "will not leave you comfortless: I will come to you" (John 14:18).
God gives and he takes -- but he will never, ever take something from you without bestowing upon you something far better than you could ever imagine. He's done it for me. Time and again, he's done it for me. And as long as I do my best to be the girl he wants me to be, he won't leave me alone. He won't leave you alone, either. It's against his nature, you know. If he wasn't there for you when you needed him, he wouldn't be God anymore. God will not and cannot break his promises if you do all you can to let him be in your life.