A* Search combines the best features of Breadth-first search (always finds optimal paths) and Best-First search (visits fewer nodes).  A* is like Best-First search, except that the priority for a node is the sum of the actual distance from the start to the node and the estimated distance to the goal:

key(node) = distance_from_start_to_node + |nodex - exitx| + |nodey - exity|

You will need to keep track of the true distance from the start in each node.  Then, when find the neighbors of a node, their distance is the distance of the current node plus one.

There are also some other minor but important modifications you need to make to the Best-First algorithm: