Do you sync your passwords to your cloud account (e.g., Microsoft account, Google account)? If you don't, then unless you backed up your passwords some other way, there's no way to recover them. But all is not lost.
Go to the sign-in page for each of those websites, where you'll almost always find a 'forgotten password?' link. Follow the instructions to choose a new password.
Suggestion for the future: Use a password manager. Many browsers have one, including Microsoft Edge, and if you sync your passwords to your cloud account you'll always have them. However, a third-party password manager will have more features and be even more secure.