I watch Survivor and am always amazed at how people go on the show and don't know how to build a fire. They don't have matches or lighters like you and I usually do. Yet many times they set up a fire that wouldn't burn even if they did have the modern luxury of instant flame.
First thing, it is best to use a camp stove when you are cooking a meal. I absolutely love a camp fire but drought conditions have been so prevailing over the last decade that it's not safe to have a campfire in many places. It's even prohibited at more and more natural parks.
Still, a good campfire is necessary and great to have once in a while. Your life could even depend on it.
Use existing fire pits and fire rings whenever possible. Don't create new ones just because it's perfect for your dream camp setup.
If you have to make one, choose a spot that is both out of the wind and outside of your tent. That is a joke but I have seen people bring open flames into their tent. Not a real smart thing to do. Clear the ground of any flammable materials and then line a diameter with stones or rocks. Save larger stones to support your cooking pot if needed. Avoid using stones from rivers as they may have absorbed water and could explode.
A good campfire needs three elements for it's foundation.
Steps for building the perfect campfire
The more dry the better. The more tinder you have the better. If you have to use damp wood in a fire, it will eventually ignite if the fire is hot enough with tinder. Pick up leaves and sticks from all over the ground. Search inside of tree stumps and around trunks of trees for more dry wood. Sometimes you can take the bark off of wet wood to find wood that is dry enough underneath.
Now sit back and enjoy the fire. Remember to make sure it is completely out before turning in for the night by covering it with water or sand.