Can someone explain in very simple words what it is. Also provide an example. So for example if u have to find the heuristic function of something how is it supposed to look
A heuristic function, is a function that calculates an approximate cost to a problem (or ranks alternatives).
For example the problem might be finding the shortest driving distance to a point. A heuristic cost would be the straight line distance to the point. It is simple and quick to calculate, an important property of most heuristics. The true distance would likely be higher as we have to stick to roads and is much harder to calculate.
Heuristic functions are often used in combination with search algorithms. You may also see the term admissible, which means the heuristic never overestimates the true cost. Admissibility can be an important quality and is required for some search algorithms like A*.