Well, usually we buy wood. If you are somewhere where you can scavenge for it, the key is not to cut any tree down. The tree must already have fallen. You don't want a live tree (green) anyway because it won't burn. So, whatever you can find that is already knocked down is safe to take. You also want dry wood. If it's wet, it won't burn as well. Usually you start with newspaper or kindling (some dry grass, small twigs, etc.). Be careful though, as newspaper, leaves, etc can flake off easily and land elsewhere in the forest. The kindling is usually inside of a log cabin structure. You can do a tepee as well. I prefer the log cabin method. Lay two logs parallel to each other and then two parallel to each other but perpendicular and on top of the initial two. Obviously, as wood burns down, apply more. You don't want to put too much wood on as it will cut off the air supply and kill the fire.
Also, I don't stop somewhere where you cannot camp. A good hiker/camper will plan this out before hand so they do not get into a situation like the one you describe. It's trespassing or squatting if you camp where you are not supposed to.
Also, if you're hiking and camping, make sure others know when and where you'll be in case you do not return as planned.
Bring plenty of water or water purification tablets and warm clothes. You can always take off layers.
Hope this helps.