To make safe edible cookie dough, use pasteurized eggs or egg substitutes, and consider using heat-treated flour. This minimizes the risk of bacterial contamination and makes the dough safe to consume raw.