Ok, so you want to cook something. Great! Step one: accomplished.
Let's say you have a recipe. Sweet. You have most of the ingredients! But not one, which you forgot, couldn't find, ran out of, or don't like. For most cooking dishes (as opposed to baking) that's not usually a problem, unless you're making an omelet without eggs. But spices, meat choices, veggie additions, and such are "suggestions".
Some are no-brainers: a recipe calls for a red onion-- go ahead and use a yellow or white. A recipe calls for peas: use another green veggie instead.
Some are no-nos: a recipe calls for heavy cream-- you cannot just substitute skim milk. Skim milk will curdle or sour where heavier creams will not. Don't boil your skim milk, ok? So, as in the previous recipe, you shouldn't carelessly substitute skim milk for the cream. You can, but you have to watch it very carefully, and probably thicken the sauce (a little flour dissolved in water will do).
Oil types fall in between. If a recipe recommends olive oil, it's probably for flavor. Sesame oil is also a flavor oil. Vegetable, peanut and canola, for example, don't taste like much, but they do have different smoke points. So you have to moderate the temperature of your pan appropriately, but you can substitute.