A. Switch between Wi-Fi and mobile data to see if the connection improves. Sometimes, one may be more stable than the other.
B. Reset your network settings. Go to Settings > System > Reset options > Reset Wi-Fi, mobile & Bluetooth. This can help resolve persistent connection issues.