Well, for one, stick to one character for long enough and you will find it easier to role play said character.
You might even find yourself growing attached to the character.
At the beginning of that campaign, I was playing the bard for laughs, joking about singing awesome evil ballads.
A year in, I was ignoring schoolwork, writing evil ballads to encourage our troops.
It also really helps the party bond. I could have gave less of a shit if our death knight died at the beginning, and at the end of it, I had to come up with bullshit excuses for trying so hard to save the party, all to save (evil) face.>"Just remember to pay me for my performances.">"How am I supposed to run this city without you bastards.">"Don't die on me, you're my source of gold and bitches."
Playing together for that long just creates a special bond I guess.
You play with these people, and you learn things about them.
For instance, our wizard is a closet edgelord, he always has black and red motifs on his ideas.
We tease him about it when we hang out.
The rogue has a heart condition, he is also lactose intolerant.
The warlock, hates it when her chips break off in the dip and likes her fries soggy.
The death knight would always complain that it's too cold, but his character would always say it's too hot.
After a few months, we were friends.
I genuinely didn't want them to die because that would make my evil little heart sad.
We try to keep in contact after everyone graduated.
Once every few months, we meet to play oneshots.