Youcan use *#*#7780#*#* if you want to reset or format your Samsung device. The code resets Android devices to the factory state and deletes all settings, 3rd-party apps, app data, S7, Note 4, Note 5, Note 6, Note 7, Galaxy J and C series, etc. and it runs on TouchWiz or Android 6.0 or below, you should try the codes described below.
SamsungGalaxy Note 4 Duos Android smartphone. Announced Oct 2014. Features 5.7″ display, Snapdragon 805 chipset, 16 MP primary camera, 3.7 MP front camera, 3000 mAh battery, 16 GB storage, 3 GB
SamsungGalaxy Note 4 (USA) Android smartphone. Announced Q4 2014. Features 5.7″ display, Snapdragon 805 chipset, 16 MP primary camera, 3.7 MP front camera, 3220 mAh battery, 32 GB storage, 3 GB