Two ways. Eating plants that access the energy of sunlight directly. or, Eating the animals that eat the plants, or eating the animals that eat the animals that eat the plants. All animals are...
Most animals don't use sunlight energy directly, unlike plants, but cold blooded animals like snakes, lizards, do need some warming up before becoming active.