Now that I know more about the game I have a list of solutions:
- Switch to peaceful mode to despawn the witch
- Run far enough away to despawn the witch
- Change to creative mode to get invulnerability
- Command give items to yourself to fight back including golden apples
- Build a bedrock wall around her to block her in until you get the weapons you need
- (Optional) Blow her up with lots of TNTs
- Prepare milk before doing