There are two schools of acting: one is Berthold Brecht’s school, which believed in distantiation (“Verfremdungseffekt” as he called it) between the actor and the role. Brecht believed you should study your role dispassionately and act in the third person.
A more common school of thought was the Stanislavski method, which led to the Actor’s Studio (where people like Marilyn Monroe and Marlon Brando came from). It influenced Hollywood and fed it with more and more stars, even to this day. The idea is simple: you become the role. This means that actors become pigeonholed (Monroe never managed to play a sophisticated brunnette, she was always the “dumb sexy blonde” in every movie she ever made). But it also means that casting is simplified. You need someone to play the bad guy? Why not take that bad guy from that other movie? Call up his agent, and there you are. It doesn’t mean that the actor is necessarily a bad person, but that he brings out his bad side every time he has to play that role.
Personally I use Brecht’s method in both theatre and film (I am NOT a professional actor, but I’ve been doing these things for fun over the last few years). I talk to the director, find out what he wants, and then try to do it. If I get it wrong, he shows me, or describes it, and I do it again until I get it right. While I’m talking, I am myself. But I can switch in and out of roles in less than a second. The word “action” instantly transforms me into that character I’m supposed to play, then the word “cut” brings me back. I could actually be joking backstage the one second, then go on stage and have a fight (in my last role I played Achilles) and then go backstage again and continue joking.
I’m sorry I cannot really explain how it’s done, I hope the theory might help though. For me, it just happens automatically. I don’t even put much effort into it (except when I’m trying hard not to laugh when I’m playing a serious role and something funny just happened).
My only advice (if you have time) is to join an amateur theatre group and see it happen during rehearsal. It’s a fun activity on top of everything else :)