where should we use contracted forms while writing dialogues? how do we chose which is better (say 'do not' or 'don't') in a particular situation while we are writing dialogues in our fiction?
As with any dialogue choices, you would use the word that the character would be most likely to use.
Try to hear them in your mind, or chose an actor to portray them (in your imagination!) and hear how that actor says the words, or write a character diary until you get the character's voice figured out, or do whatever else you need to do until you understand that character and know what words s/he would use.
And, of course, keep in mind that the same character will speak differently in different situations.
But it all comes down to knowing your characters, and using that knowledge to have them behave in character.
Imagine you're a child and your Dad is giving you some friendly advice.
"Don't get too close to the cliff edge."
Now imagine your Dad is giving your teenage self the world's coldest and most deliberate telling off.
"Do not EVER backchat me like that again!"
Same man, different context. A work mate is asking a question.
"I've no idea. I haven't a clue. I wouldn't even know where to start looking for answers."
Same man, different context. He's a lawyer in Court.
"Do not think, ladies and gentlemen of the jury, that the accused is as innocent as he seems. He may look as if he would not hurt a fly but I intend to demonstrate that he has not got an alibi for the night in question and that he killed more than forty innocent people before dawn."
As the first answer states, it all depends on context, the status and education of the speaker and the effect they are trying to achieve. Generally speaking, very formal contexts or contexts where we are deliberately trying to impress are when we use the expanded form of words, more informal occasions are when we tend to use the contracted forms.