How do I make it so the folder isn't viewable to the outside world. I created a login page which is login.php but when you type in examplesite.com/admin it shows everything inside the folder.. How would I hide all that? - Is that a .htaccess thing?

Usually you can set this in your control panel. In .htaccess I think it is:

Options -Indexes

Options -Indexes

Quoted Text Here

Is there any other ways of doing this? I just want to keep people out..

That's what you asked for. Or do you want to password protect the folder? That option is somewhere in your cPanel (or whichever control panel you use).

Say if I'm not using cpanel.. Like for example I have a login and I want it so people who are not logged can't see the files..

so options Indexs will block it so people can't see inside the folders?

I am familiar with IIS, and in IIS its called "Directory Browsing". If you are running on Apache, there is an equivalent..I assume? Sorry cant be more specific, not very familiar with Apache...yet.

so options Indexs will block it so people can't see inside the folders?

That option prevents you from seeing the directory listing, nothing more. If you want password protected folders you need to use .htaccess and .htpasswd files.