Which of the followings is correct?
1) why you did not drink that juice?
2) why did not you drink that juice?
I think both of them are correct but I don't know which one is more formal! Any further explanations will be appreciated. :)
Neither of the given examples is actually correct (they are both ungrammatical in modern English). The phrase should be either:
Why did you not drink that juice?
Why didn't you drink that juice?
The first one ("did you not") is the more formal of the two; the contracted form ("didn't you") is much more likely to be heard in conversation.
This has been covered in ELU under the answer to this question: https://english.stackexchange.com/questions/8372/do-you-not-vs-dont-you