Question: First, I am new to GitHub.

 I know how to create branches in GitHub, but the problem is that when I try to make a new branch, it duplicates the master branch. What happened?

You should look at this: In the master branch I have a main.cpp and a readme.md. Now in the 'libraries' branch I mentioned is when I that I just created has the same contents. As I said it contains .h files part of the repo.

Answer: 
Branching uses the current master branch as a basis for a new branch. If you want a blank slate, the best practice is to create a new project.
That's how branches are meant to be used. They are supposed to duplicate and then extend the master.