External display mirrors Galaxy screen instead of launching DeX

External display mirrors Galaxy screen instead of launching DeX
Restart your device.
Swipe down with two fingers from the top of the screen to open the Quick settings panel. Tap the Power icon at the top of the screen. Next, tap Restart, and then tap Restart again.
Your device will shut down and automatically reboot.
Check for software updates.
On your device, navigate to and open Settings. Swipe to and tap Software update or System updates. It will vary between models. Tap Download and install or Check for software updates.
If an update is available, it will begin downloading, though you may need to tap Download now on some devices. When the download is complete, follow the on-screen instructions to install the update.
You can also check for updates using Smart Switch.
Check the cable and connection.

Access the DeX settings.
From your phone or tablet, swipe down with two fingers from the top of the screen to open the Quick settings panel. Tap the DeX (desktop-shaped) icon to enable DeX mode.
DeX should automatically launch on the external display. If the phone or tablet screen is being mirrored, proceed to the next step.
Adjust mirroring options in the DeX settings.
From your phone or tablet, swipe down with two fingers from the top of the screen to open the Quick settings panel, and then tap the Settings icon. Next, tap Connected devices, and then tap Samsung DeX. Now, tap Connected display, and then tap Extend to ensure DeX mode is active.