A ketogenic diet is a diet that causes your body to switch away from primarily using glucose for energy to burning ketones. It's not to be confused with ketosis. Ketosis is when your body is producing ketones from fat. When you are keto-adapted, not only are you making ketones but you are making enough that your brain can comfortably run on them while your muscles are predeominantly burning fats. When the ratio of macronutrients (fat/protein/carbohydrates) you eat are ketogenic, over time your body will make the switch. The term ketogenic was originally coined for a diet used to help prevent/reduce seizures in children, though it's a diet that can be very helpful to many types of people.
It can take up to 2 weeks for your body to fully adapt. Maybe even longer if you are coming from a high carbohydrate diet, have diabetes, or have to spend time experimenting to find the appropriate amount of protein. As you make the switch your body's nutrient requirements will change. The most important difference is that your body will stop retaining water and sodium (salt). This is what causes the rapid weight loss in the beginning weeks and is also why if you do not add back more sodium into your diet, you may experience headaches, muscle cramps, fatigue, faintness when standing up or constipation. Luckily it's easy to get enough sodium (an extra 2-3g1) to avoid these symptoms, just make sure to salt your food (to taste) and drink a cup of salty broth every day.
A common ketogenic ratio is 1:2:4, e.g. for every 1g of carbohydrate I eat 2g of protein and 4 g fat. Ideally these ratios should be true for both your meals and the day's totals. I find it easier to think in terms of calorie percentages which would be:
Personally, since I have such a hard time with carbohydrates I use a slightly modified ratio and I restrict the amount of carbohydrates to less than 30g instead of relying on a percentage.