To put it simply, upaya is starting from where you are and working with what you have in order to start creating. Upaya can involve unconventional methods that do not find mention in Buddhist doctrines, the only rule being that the action must involve compassion and wisdom. It is also essential that the action is the need of the moment.
"Lotus Sutra," which is considered one of the most influential texts of Buddhism, elaborates on the importance of upaya. The second chapter in the text highlights the importance of upaya, while in the third chapter, Buddha explains upaya with the following illustration:
"A man returns home to find his house in flames with his children inside playing happily, not realizing the consequences of the fire. The man calls his children to come out, but being involved in their game, the children refuse to do so. With no other option to bring them out, the father tells them that he has brought them beautiful carts that are drawn by goats, deer and bullock. His statement made the children come out immediately, but only to find nothing their father had promised. However, the relieved father soon got them more than what he had told them to make them get out of the house on fire."
Buddha tells his disciples that though the father uttered a false statement, it cannot be considered faulty as it was his earnest attempt to save his children. The father had applied upaya that fit the situation to bring his children out of danger.