The inability of your PS5 to connect online stems from Wi-Fi problems combined with problems in your router and outages affecting the PlayStation Network. The resolution includes router rebooting and PSN status checks together with wired connection testing and PS5 network reset procedures.
Your PS5 may not connect to the internet due to Wi-Fi issues, router problems, or network settings. Restart your router and PS5, check for updates, or try a wired connection.