You may have seen a file in some of your folders called .DS_Store. The dot means this is a hidden file so it won't usually show up in Finder. .DS_Store stands for Desktop Services Store and is used to store folder specific settings. If many of your folders have different view options, it's because their unique .DS_Store files have different settings.
First, we want to set the default view options for all new Finder windows. To do so, open Finder and click on the view setting that you want to use. The settings are four icons and the top of your Finder window.
If you don't see the Finder toolbar type:
cmd + option + t
After selecting the option you want, type:
cmd + j
to open the view options window.
Make sure you check the top two checkboxes that say Always open in list view and Browse in list view. Keep in mind it will reflect whichever view you've selected.
Now click the button at the bottom that says "Use as Defaults".
Chances are you've opened some Finder windows in the past. Individual folder options will override this default setting that we just set.
In order reset your folder settings across the entire machine we have to delete all .DS_Store files. This will ensure that all folders start fresh. Open up the Terminal application (Applications/Utilities/Terminal), and type:
sudo find / -name .DS_Store -delete; killall Finder
You will then be prompted for your password. You won't see your password as you type, so type carefully. This may take a minute or two because it's going to search your entire computer for .DS_Store files.
If you're worried about losing precious settings, you can simply change the view options for each folder individually. So whenever you navigate to a folder in Finder that doesn't have your preferred layout, simply change it. This won't be an instant fix, but it will ensure that you don't lose any of your existing settings.
I always keep an eye on my MacBook's battery percentage—especially since, as a developer, I run a lot of resource-intensive applications.