Check the PlayStation™Network status page to see if there are network issues.
If you are using a wireless connection, try bringing your PlayStation®4 console closer to your router and removing anything interrupting the connection between the devices.
Perform an Internet connection test from Network settings.
Turn off your router, wait at least five minutes, then restart it.
Try using a wired Internet connection if possible.
Update your router to the latest firmware. For details on how to update, please contact the manufacturer.
If possible, try opening the ports. TCP: 80, 443, 3478, 3479, 3480 and UDP: 3478, 3479, 49152 to 65535. For details on how to open ports, please contact your Internet Service Provider.