We have had grain moths before (both times they came in brand new whole grains we bought) it just happens. What has worked for us every time is you need to go through all of your grain and cereals that are opened and check for larva and moths. Throw out anything and everything that is infected (right out side don't leave it in the house)
Once you have checked everything make sure you wash out the cabinet or wherever your grains are with either a bleach solution or something similar. And make sure everything goes back in a sealed container. I used clorox clean up and even though we had to throw out a lot of food they never came back.
Sorry I can't help with the cloth moths, we've never had those. I would try the moth balls.