How to print edible food? I would like to print edible cookies or ornamentation for a cake.

Is printing with edible materials achievable by standard thermoplastic-like 3D desktop printer? Or you need to buy a special printer to do that?
You cannot print edible models using a "standard" consumer 3D printer without first installing an "hot end" capable of depositing edible - normally thicker - substances as well as a suitable extruder mechanism. 

However, there are not necessarily any technical limitations in the electronics, software, slicers etc. in a typical printer that wouldn't allow you to install such an upgrade. For instance, you could calibrate your extrusion rate and nozzle width to suit batter and similar.

Some commercial printers, such as the DeltaWASP allow for upgrades that print clay, which wouldn't be very different from printing liquid food.