Though several garden tools such as chainsaws and weed eaters will have oil injectors, sometimes premixed gas and oil is necessary. Newer garden tool models will often not require premixed gasoline, however older models, and sometimes due to size, weight, or cost it is better to use a gasoline/oil mixture. In general there will be a recommended ratio of gasoline to two cycle oil, and it differs depending on the machine you are using. Check online before you mix gasoline and oil to ensure there will be no permanent damage to your equipment.
Once you have discovered the recommended ratio, simply apply the ratio to the total amount of gasoline, and determine the amount of two cycle oil needed. For example, if your chainsaw has a 16:1 recommended ratio, and a one gallon tank, you will want to use a half pint of two cycle oil.