The term is nearly always used in a negative light but typecasting is not only a good casting decision nine times out of ten, it is also the backbone of an actor’s career.
Back in 2011, I played the lead role in my second feature film, a neo-noir detective thriller titled The Detective’s Lover. At the time with very little experience under my belt, I felt confident about playing “the hero”. This was a mistake. I can’t play the hero, or at least not the usual hero type. It didn’t sell at all. No one could take me seriously in the role and what was intended as a dark, gritty thriller turned into a farce mostly based on my performance. Flash forward a couple years later and I decided to act in my films once again, this time playing a few supporting parts in the 52 short films I made during 2013. The characters were varied: a homeless man, an inattentive husband, a meek single guy looking for a date, and a gang leader. Can you see me as the leader of a criminal outfit? At the time, I thought of this as playing against type but in fact, I was about to find my type. Turns out that I fit the role well, garnered quite a positive reactions on set, got good feedback from the finished film, and most importantly I felt comfortable playing the character. “Maybe I should play more bad guys,” I considered and since then I have gravitated towards those roles. 
I can play the psychos, the sociopaths, the weirdos, the killers. From the crazy gun shop owner in The Deadbeats to one of America’s first serial killers in The Wilderness Road, these are the kind of roles I can play with some level of success. By my estimation, I’m also not bad at playing the goofball, as demonstrated in The Woman Who Robbed the Stagecoach and The Adventures of Bandit and Wild Wes. I like to put it this way: I can play the villain or the fool. All this is to say that we’re not all the leading man or woman even if most of us want to be. Very few of us grew up imagining ourselves as the sidekick in our movie fantasies but that’s who most of us are. I know so many actors who don’t recognize their type and are constantly at odds with it. To me, they’re like hamsters on a spinning wheel, never going anywhere. Realizing your place in the cinematic landscape is healthy and important to success. 
Another brief example: years ago I was seeing an actress who consistently complained about being cast as “the mom” character. Now keep in mind, this person was not famous. They were experiencing a moderate degree of success in the local film industry, chosen for several commercials, short films, and a couple features. Instead of embracing these mom characters, she always wanted to play the bad girl or slutty type. But she was the mom type and my advice to her was to own that as much as possible, perfect playing those kinds of roles, and to use her type to achieve a level of success that would allow her to easily pick and choose whatever role she wanted. If you pay attention to the careers of most famous actors, male and female, that’s exactly what they did. 
Just the other day, I showed my girlfriend Killer Joe starring Matthew McConaughey. “I don’t know if I can believe him in a serious role,” she said, remembering him most from the string of romantic comedy successes earlier in his career. Well, that was his type. He played it over and over again. Then about 12 years ago, he came to his wife and told her he wanted to switch things up, make less money, and play different roles. In this case, it worked in his favor. He changed most audience members’ perception of his type, giving us the wonderful Dallas Buyers Club and that sinister killer in Friedkin’s film. Some actors at a high level in their career are capable of playing against type. Some are not. I’d argue that recent misfires from someone like Brad Pitt are mostly the result of playing the wrong roles. He and his management team have lost the sense of what he does best and it has diminished his position as a movie star. The old Hollywood studio system understood type and very rarely made mistakes with how they positioned actors and actress. They were even good at “casting” directors for the right projects, knowing who was good at making what. Sadly that thinking is mostly exinct in today’s hollywood. 
But what about character actors? These chameleons can play a wider variety of parts than the hero types. Just look at Willem Dafoe who can successfully play Jesus and also the Green Goblin. A few character actors are capable of playing character leads, often an offbeat leading role. Jeff Bridges is more of a character actor in my opinion than a typical leading man however he is believable as the “hero” but usually in an unusual way: the Dude in The Big Lebowski, Rooster Cogburn in True Grit. I digress. 
To return to my own career, here’s one more thing to think about. I write/produce/direct these movies. I make all the casting decisions. Therefore, I could easily cast myself as the hero every time so why don’t I? Because I’m honest with myself and know my type. Last year, I even turned down a role in this other filmmaker’s project because I wasn’t the right fit. This year, she’s offered me another role and, though it’s a lead part in a love story, I might take it because the character is not a typical romantic protagonist. He’s a troubled, grieving alcoholic and that might be a fun challenge to stretch my abilities while still staying within the range of what I can play. 
To all my fellow actors out there, my advice to you is the same I gave that actress years ago: figure out your type, own your type, and use it to achieve success.