Make sure you set up port forwarding for your PS4. Set it up on a static IP as well, if your router tends to assign it different IP addresses. Open up all the ports it needs for PSN as well remote play.
If you're playing distance from a far away connection, make sure you go on your PS4 before you leave the house, and…