To enable Nearby Device Scanning on a Samsung mobile with OneUI 4.0, follow these steps: 1. Go to your phone's settings. 2. Click on 'Connections.' 3. Select 'More connection settings.' 4. Choose 'Nearby device scanning.' 5. Toggle the switch to turn on the feature.