We as humans make mistake and we should learn from them and move on. if we are forever stuck in past we will never be able to enjoy our present moment or plan our future adequately. Due to circumstances sometimes we lose our cool and behave erratic but now that you have realized it, you should pen down your behavior which you found negative and tear it each time after penning it down.
Next Steps
consult a psychologist offline or online