There are two ways to teach yourself to cook. One is to ask people around you when you go to a restaurant, including mom, neighbors and chefs, to be familiar with the most basic cooking skills. One is reading cookbooks. Buying some cookbooks can obviously broaden your horizons and technical level.
And now there are recipes online. All you have to do is search what you want to cook, what ingredients, what seasonings, cooking methods and how much calories you have. . .
Learn more and practice more. Practice makes perfect.