This can happen if you heat your chocolate too quickly or too much, so my best piece of advice is to avoid those two things first. To thin your chocolate, stir in a small amount of vegetable oil (coconut oil works too!) or shortening until you get the right consistency.