If you encounter such a situation, then when you make some confessions, you must not make guilty confessions. Because if there's a precedent. With the first time, the court won't believe that you don't have a second time, so we should warn ourselves not to touch this bottom line. Otherwise, you will find that the evidence can not only get rid of your doubts, but also confirm you.
Secondly, you need to find a professional law firm to defend you. Because of their professional ability, they understand that you are wronged, and they can also find some loopholes from the evidence to get rid of your doubts. And professional lawyers can help you a lot in the process of defending you, so don't underestimate lawyers.
Finally, because you are not drunk, the evidence only points those doubts at you, and there is no substantive explanation to prove that you did it, so don't panic. According to what you have seen and learned, you should always state the facts to the judge instead of fiddling blindly, especially in court. You should be measured, well-founded, keep a clear head, and point out that you should confess what you say, and what you say must be true, because once something is false, it may prejudice the truth of the whole investigation. Inconsistency between words and deeds will make people feel that there is false information in your words, which will bring a shattered glass effect to others in the process of defending yourself. And you have to firmly believe that since you haven't done it, you are justified!