Drain all fuel and bar oil from the chainsaw.
Start the chainsaw and allow to idle (chain brake disengaged) until all of the fuel has run out and the chainsaw stops working.