Lord Shiva has such a deep and distinct devotion to Lord Rama. In order to serve his master, Lord Shiva assumed the form of Lord Hanuman when Lord Vishnu took on the form of Rama on the earth. The monkey god Hanuman is well-known for his bravery, strength, and devoted, selfless service. The world has not seen, nor will it see, a powerful hero like Sri Hanuman in the future.
The question of "what would be the perfect form to serve with love and devotion?" emerged when Lord Shiva chose to take on the form of a human in order to serve his master. Taking on the human form of the Lord is against the dharma, or the duty of seva. Based on this, he chose to adopt the monkey's lesser form in order to maintain his master's superiority. He believed that a monkey did not require cooked meals, meat, a bed, or decorations. He is condition-adaptive. Shiva was so devoted and loving.
An incarnation of Lord Shiva is Lord Hanuman. In several Sanskrit sources, including the Mahabhagvata Purana, the Skanda Purana, the Brhaddharma Purana, and the Mahanataka, Hanuman Ji is described as an avatar of Shiva or Rudra. The Odia text Rasavinoda, authored by Dinakrishnadasa in the 17th century, further states that Lord Hanuman is the merged form of the three gods Brahma, Vishnu, and Shiva.
An incarnation of Lord Shiva is Lord Hanuman. In several Sanskrit sources, including the Mahabhagvata Purana, the Skanda Purana, the Brhaddharma Purana, and the Mahanataka, Hanuman Ji is described as an avatar of Shiva or Rudra. The Odia text Rasavinoda, authored by Dinakrishnadasa in the 17th century, further states that Lord Hanuman is the merged form of the three gods Brahma, Vishnu, and Shiva.
If you have any doubts. Please let me know.