The trick here is not only to avoid all obvious sources of carbohydrate (sweets, bread, spaghetti, rice, potatoes), but also to be careful with your protein intake. If you eat large amounts of meat, eggs and the like, the excess protein will be converted into glucose in your body. Large amounts of protein can also raise your insulin levels somewhat. This compromises optimal ketosis.
H. Guldbrand, B. Dizdar, B. Bunjaku, T. Lindström, M. Bachrach-Lindström, M. Fredrikson, C. J. Östgren, F. H. Nystrom, “In Type 2 Diabetes, Randomisation to Advice to Follow a Low-carbohydrate Diet Transiently Improves Glycaemic Control Compared with Advice to Follow a Low-fat Diet Producing a Similar Weight Loss,” Diabetologia (2012) 55: 2118. http://link.springer.com/article/10.1007/s00125-012-2567-4.
"When going out for fast food, I used to get the large-size value meal. Now, I satisfy a craving by ordering just one item: a small order of fries or a six-piece box of chicken nuggets. So far, I've shaved off 16 pounds in seven weeks, and I'm on track to being thinner than my high school self for my 10-year reunion later this year." —Miranda Jarrell, Birmingham, AL