As a first step you need to enable anonymous access at web application level and go to the site collection in which you want set up the anonymous access. One thing to ensure is that the site is accessed through a proper zone in which anonymous access is enabled at the web application level. For example I have created a web application in port 80 and extended it for internet in port 4040 and enabled the anonymous access for the internet zone. Then I should access the site with port 4040 or with the proper host header to set the anonymous access at the site collection level.

Go to Site Settings, click on "Site Permissions".

Click on "Anonymous Access".

Give anonymous permission to the entire web site unless you want to enable it for a specific list, uncheck the "Require Use Remote Interface" Permission.

Click "Ok" to save the changes, then close the browser and access the site again; it will not prompt you.

SharePoint Library Level

As a first step, ensure anonymous access is enabled at the web application level.

Go to any library and click on "Library settings".

Go to the permission.

Click on "Stop inheriting".

Click on "Anonymous Access".

Set the permission for the anonymous user.

By default an anonymous user cannot add and edit items in a document library, which is disabled, even with anonymous access enabled. So for a document library all options will be greyed except "View documents". For a SharePoint list you can allow anonymous users to perform all operations as in the following.

Application Page Level

You need to deactivate the following feature to allow anonymous users to access application level pages.