Sometimes when the time of the condition is not the same as the time of the result, we use mixed conditionals (usually types 2 and 3, but other combinations are possible as well):
If I had studied harder, I wouldn't get a bad mark. (But, I didn't study and now I have a bad mark; past condition and present result)
If I did my homework, I would have gone to that party. (But, I didn't do my homework and can't go to the party; present condition and past result)
If he missed the bus, he won't be here on time. (present condition and future result)
For more visual explanation, go here, or watch this video: