Pain under the foot can be multiple things. It could be a foreign object in the foot. It might be the shoes your wearing. Go to your doctor if the pain doesn't go away.
If you stepped on something and bruised your foot you would be in pain. You may also have something stuck in your foot or you could have ripped a tendon. Go see a podiatrist.
Walking around and stepping on a thumb tack will cause some pain. Best way to heal your foot is to remove the tack, apply some ointment and cover the injury with a bandage.