But it's unlikely the Police officer actually "witnessed" anything that'll help you.
If you tell police officer you did something bad, it's essentially a confession and reported as such.
If you tell police officer you did something good, it's hearsay - you told it to officer who told it to judge & jury.
Then there's jurisdictional details as to their role and rules of evidence etc that will vary from country to country.
But it's a shocking revelation to most people that Police cannot effectively help you in court. That's not their role.
-----------------------
Edit: Found it - federal rule of evidence 801(d)(2)(a) - Opposing Party Statement
https://www.uscourts.gov/sites/default/files/federal_rules_o...
Police have a responsibility to testify truthfully under oath, within the constraints of the rules on hearsay. But that doesn’t mean they are forbidden from saying anything in your favor, no matter what.
In other words, if you try to introduce an out-of-court statement that supports your case, it's hearsay; if the statement is against your interest, it's allowable.
Of course there are other exceptions and nuances, but this is the jist of it.
Witnessing things is a completely different matter.
This is because the people who wrote the evidence rules believe nobody would admit to a crime unless they are guilty. So it's a hearsay exception.
The exception isn't meant to be a sinister trick to treat you unfairly, it's meant to lead to the right people going to jail and the right people not going to jail.
During Mirandized interrogation:
Doe: "I grabbed her wrists after she picked up a knife to attack me."
In court:
Prosecutor: "What, if anything, did you learn from questioning Mr. Doe?"
Officer: "He said he grabbed her wrists."
Defense attorney on cross-examination: "In what context did Mr. Doe grab her wrists?"
Officer: "After she picked up a kni--"
Prosecutor: "Objection! Hearsay!"
Judge: "Sustained. Jury will disregard anything about the accuser picking up a knife. Wrist grabbing stuff is fine."
^Not remotely how it works, at all, but what you might falsely believe from being told "your words are admissible against you, not for you".
I have a friend who is a federal criminal investigator and his advice when/if the feds show up is to say nothing other than "Do you have a business card? Someone will be in touch." and get a lawyer ASAP.
[0] - https://www.iannfriedman.com/blog/2019/april/federal-charges...
[1] - https://www.pallegarlawfirm.com/obstructing-justice-in-flori...