Many stories are basic at the core: hero vs. villain, good vs. evil. But life isn't always so black and white...so books can't be, either. Not all main characters are heroic. Some, in fact, are just the opposite.
Bette Davis Eyes
In literature, heroes are good guys. They are honest, or noble, unselfish maybe, and caring of others. They're designed to be lovable.
Not so with the anti-hero. This character is barely likable. They make bad decisions and wrong choices. They lack admirable qualities and maybe even do really dumb things.
The big trick is getting readers to enjoy their exploits anyway. But in a lot of ways, it's easier for readers to identify with anti-heroes. They make mistakes and do dumb things, just like the rest of us.
Heroes, on the other hand, do the right thing. They don't always walk the path of least resistance. They make hard choices and save the day.
And that can get annoying. This is why authors caution other authors to give their characters flaws. It's easy to like and admire heroes, but not necessarily easy to relate to them.
The best characters are complicated. They have some heroic traits, but sometimes they do the stuff you find in anti-heroes. Blend both character types together to create a main character who is complicated, relatable, likable and entertaining. Do that, and you've got a great book.