When you accidentally shot the wrong target, you will have bounty on you, but if you did very little damage and did not kill the target, this bounty is small and lasts 10 minutes and then turns to small fine. You should escape immediately, jump to closest system, wait for 10 minutes (you can see the timer on the bounty in transactions tab), jump back and continue with your business. Then when you visit a station in this system, pay off the fine and you are good. Do not forget to pay the fine, if you did then fine turns to bounty after some time.
If you commit suicide having bounty on you, then bounty turns to dormant bounty. You are not wanted anymore, but after any security or bounty hunter scans you (with Kill Warrant Scanner?) in the system where you had the bounty, dormant bounty turns to real bounty and you become wanted immediately.
Dormant bounties turn to fines too after time passes.