Online play involves competing against other players on the internet, so connection issues could arise depending on your and/or your opponent's network connection.
To minimize said issues, please connect your console directly to your router using a LAN cable and such, plus double-check your network device settings.
----------
For general network troubleshooting, please try the following steps and see if any of them resolve the issue:
1.) Restart the game and any network devices (modems, routers, etc.), wait for a short while, and then try playing the game again.
2.) If using a wireless connection, try switching to a wired connection. Wireless connections are more susceptible to connectivity issues, while wired connections are generally more stable.
3.) Always make sure that your console's date and time are set correctly before playing. Incorrect date and time settings could cause unexpected issues or prevent you from joining in-game limited time events.
▼Please check Sony's support page as well:
https://www.playstation.com/en-us/support/connectivity/
If your issues still persist despite checking all of the above, it could mean that there is a problem with your opponent's network connection.
----------