This article explains what to do if your PSN account has been hacked. Instructions apply to PS5, PS4, and PS3.
If you suspect that your PSN account has been compromised, you should take the following actions immediately:
The first action you should take if your PSN account gets hacked is to change your password.
Go to the PSN Account Management login page, sign in if prompted, then select Security on the left.