The general advice regarding a self-defense claim is simple: You should not hit first. If the other person strikes you, then you can defend yourself. If you hit them first, you could find yourself facing assault charges because you instigated the fights.
That said, there are some rare situations in which you can hit first and still claim it was self-defense. A case like this may be tricky, but it is occasionally possible.
Generally, you need to have a reasonable belief that you are about to suffer harm. You can then protect yourself, even if you haven’t suffered that harm yet, so long as you honestly believe the only way to avoid it is to hit first.
For example, maybe someone threatened you from the other side of the street. They said they’re going to come over to your side and beat you up. As they start crossing the street, you realize that they’re twice as big as you and there’s nowhere to run. You hurry forward and hit them first, giving yourself time to make a break for it while they recover. You may be able to claim that you had no choice but to respond to the threat because you thought it was a valid threat and, due to their size, you knew you’d get seriously injured if you let them reach you and strike first.
Again, while this may be legal, it can make for a complicated case, especially if they contend that they never threatened you. Be sure you understand all of your legal defense options at this time.