Getting back to those hidden codes, no those won't help you in this instance. Those are for diagnosing and modifying hardware and operating system related issues.
Determining just what is the exact problem will be harder to do. It sounds like perhaps someone compromised your FB account, allowing them access into your phone. But that's just a guess at best.
If you have access to a computer/laptop, try this. Set your phone down, and then on your computer access your email, your Facebook, and probably your other online social media accounts, and change your password. (You don't want to do this on your phone as if it is compromised, you want to reset your passwords elsewhere. Logging in via web interfaces bypasses the apps on your phone.) Now just restart your phone as this will reset everything (email app, FB app, etc.) so when you first use each one you'll need to re-establish their auto-logins using their respective, new passwords.
If you still suspect something is wrong, you might want to do a Factory Reset. But that's more a last resort kind of thing, and it's really important you have backups of all your personal data before you do the Reset. And don't just assume things are backed up, confirm the data is there - i.e. if you use Google Photos be sure to log into
https://photos.google.com to check your photo library is there; if you use something SMS Backup Restore be sure the backup xml file is where saved it to; if you have your music/audio library backed up to a mcroSD card, use a file manager app to check the files are there; etc.