To make a cake you need one egg, three pieces of wheat, three pieces of milk, and two pieces of sugar.
For the egg find a chicken running around somewhere and follow it until it poops an egg, then just take it.
To get wheat, hit on the ground with your hoe until you get some wheat seeds. To plant them, find some ground next to water and use your hoe on the ground (grass or dirt - either will grow wheat). Then use the hoe again to till the ground and plant the seeds. You'll have to wait 1-3 in-game days for the wheat to grow before you can harvest it. Once it has grown, whack it with your hoe again to harvest it.
For milk, you must craft three buckets from nine pieces of iron (craft them in the "Food" tab). Then use those buckets on a cow and you'll receive milk.
Sugar must be crafted from sugar cane. These can be found on the outskirts of lakes (they resemble reeds).
Once you have all these, go to the "Food" tab in the inventory and create your lie cake.