Burning mothballs in your fireplace or wood stove does help to loosen up and remove some creosote buildup from the chimney but it is not a complete cure or remedy for cleaning creosote.
You still need to have the chimney cleaned with a chimney brush either by yourself or have a chimney sweep come clean the chimney out.
The vapor that is released from the mothballs during the burning of the mothballs is what cleans and loosens the creosote.