Stepper motor step counting

Hi,
Could you please suggest me solutions for counting steps of my stepper motor.
Default Arduino library ways aren't helpful.
Thanks in advance.

Default Arduino library ways aren't helpful.

What's the problem? If your software tells the motor to take 10 steps, it's gonna' take 10 steps.

So, the software always "knows" although you may have to add some extra code to keep track of what's happened in the past to know where you are.

If you have some kind of mechanical problem and the motor doesn't move or if it misses-steps, that's another issue.

The problem is when I use a stepper motor driver , it doesn't know the position of the motor . That is the main reason why I'm not using the default Adruino library.

You aren't giving enough information to be able to reply with accurate advice.
What is the board you are programming?
What is the stepper motor you are using?
What is the driver you are using?

Here is some basic information on unipolar stepper drivers.

If you need to know the position of the motor you will need an encoder to return clock counts and then you will have to decipher these in your code

Have you looked at the AccelStepper library, that does what you want: moveTo, distanceToGo, currentPosition, targetPosition