If the chainsaw fuel has been in the tank unused for months, it can pick up moisture and fail to ignite (that's why you should drain the fuel before storing the chainsaw or add gas treated with fuel stabilizer). Replace the fuel with fresh gas if it's old and not treated with stabilizer. You might also need to replace the fuel filter at the same time.
Doing preventive maintenance including a tune-up also helps the engine run smoothly. Check the fuel lines for cracks and replace them if necessary. If you still have problems after checking those issues, consider replacing or rebuilding the carburetor.