Forests have an important role in environmental preservation and maintenance. The primary threat is forest fires, which have disastrous repercussions. As a result, it is critical to identify and extinguish a fire before it spreads and destroys resources. To that end, we propose a forest fire detection and fighting mechanism using wireless sensor and actor networks (WSANs). Temperature sensors are utilized to detect fires, and actors (robots) are employed to extinguish them. Sensors and robots are distributed at random throughout the forest, forming clusters. Clustering, sleep/active scheduling for the sensors, and energy harvesting (EH)/moving modes for the robots, are used to extend and maximize the sensors/robots lifetime in the WSAN. In such a network, robots should move to the fire site as quickly as possible. To do this, we further propose a robot routing mechanism that focuses on determining the shortest path for each firefighting robot. In particular, each firefighting robot equipped with on-board processing uses a fuzzy Q-learning (FQL)-based trajectory mechanism to learn the shortest path to the fire zone in the least amount of time. Simulations are conducted to demonstrate the benefits of employing the proposed framework for rapid and effective fire response. When compared to the traditional Q-learning, the total approaching rate (a measure of how quickly the firefighting robots can reach the fire) to the fire spot is greater when utilizing the proposed FQL-based strategy.