Refer to the user manual or support page on Samsung's website (https://www.samsung.com/us/support/answer/ANS00062029/) for how to do a factory reset on your current device, prior to shipping it back to Samsung.
In addition, make sure that you remove all passwords, locks, SIM cards and memory cards before sending the device to Samsung. If these items are sent with your device, they will not be returned. Please note that Samsung assumes no responsibility for any personal information you leave on your device when you ship it back to Samsung as a upgrade return