You can do it numerically as it is mentioned above. If it is a sharp changing function you have to use some numerical tricks. Those tricks can become very advanced up to a PhD level thesis. But as starting point fitting a spline locally and get the derivative of the spline at that point is a common practice.