You can wait to use Cutting Words after the roll, but you must commit to doing so before you know for sure whether the total of the roll or check is a success or a failure. You can use Cutting Words to reduce the damage from any effect that calls for a damage roll (including magic missile) even if the damage roll is not preceded by an attack roll.