The process of producing carbohydrate molecules by utilizing carbon dioxide and water molecules as substrates is known as photosynthesis.
The plants can perform photosynthesis which allows them to create their food.
The plants absorb the energy from sunlight to perform the process.
The carbohydrate molecules produced by the process are used for generating energy that can be used for metabolic activities. Plants also store the carbohydrate molecules for later use.
Therefore, plants can get their food by performing photosynthesis.