You could try setting an alarm to take your dog out during the night. Take them out right before bedtime too. If accidents continue, restrict access and confine them to an easy-to-clean area at night. Patience and consistency are key; don’t punish them, just gently guide them outside.