It depends on the app:
Non-Apple applications states or data can be found in ~/Library/Application Support/ usually.
Copying the folder named as the app to the respective path in your new system should restore most things.
This works for Firefox and Chrome.
It's also adviseable to copy the content of ~/Library/Saved Application State/.
Some Apple apps have their own folder in ~/Library/ like Safari and Mail. To get the Safari data and especially all your mails (in Mail), copy those folders. Others have their states/data in ~/Library/Group Containers/ or ~/Library/Containers/.
Copy the folder ~/Library/Keychains to your (new) desktop and import your passwords. If you are also using a password app like 1Password, copy the respective folder in ~/Library/Application Support/.
Copy all preferences files ~/Library/Preferences/. Also check for invisible files and folders in ~/, ~/Preferences, ~/Library, /Library or /. They often contain either config files (e.g. .ssh) or even auth files or serial numbers for apps you purchased in the past.
You neither specified a system version nor an app version. Depending on your system or app version and purchase type (App Store or conventional) paths may vary.