If your Galaxy S8+ is misbehaving or you're selling it to someone else, you can perform a factory reset. This will erase everything and make it like it was when you first powered it on.
- Go to Settings > General management
- Select Reset
- Select Factory reset
- Tap the Reset button
- Enter your password
- Tap Delete All