reset counter or whole program, not hardware restart

i am making a counter program is okay but i fount i need to zeroing the counter when reached certain number or when some button has been pressed i tried the on board reset button, it is okay but taking too long any suggestion???

Let's see your code and an explanation of how your button is wired.

What counter?

If you are talking about a timer in the microcontroller, you can clear the TCNTn register. For example, timer 1 would be:

TCNT1 = 0;

Or do you mean millis()?

any suggestion???

Yes write code to do it? Use an if statement to check for the button or counter exceeding the maximum and conditionally set the counter back to zero.