Google "plantar fasciitis." From your brief description I can't be sure, but it sounds like this is your problem. Also called "heel spur", but this makes people think there is some kind of boney spur poking into the flesh with each step, which is incorrect.
There is a ligament that runs from the ball of the foot back to the heel bone. When the arch flattens, this ligament pulls on its attachment point at the heel bone and that causes the pain. (Just by way of explanation, the pulling on the attachment point at the heel causes a horizontal calcification that shows up on xray as spur-like, which is where that name comes from.)
Podiatrists treat this condition with Alieve (naproxen), custom arch supports (orthotics) and sometimes, direct injections of cortisone.
I have the custom arch supports and I did have a number of cortisone injections back in the '80s. I have been pain free for most of 2 decades now.
In my experience, the single most important thing is good arch support. This means never going barefoot, not even from the bed to the toilet. (The ligament shrinks overnight while you sleep, so the pull on the attachment point is expecially severe first thing in the morning.) Birkenstock sandals are a lifesaver because of the arch support design. My Podiatrist recommended them. He actually used to write out "prescriptions" so that people would be excused for wearing them at work. I keep my pair right beside the bed and slide into them as I get up to hit the can. I actually need to take baths instead of showers because of the no standing barefoot thing. In the summer, I use a pair of plastic Birkenstocks and an outdoor shower at the back of the house (beach community).
Whether or not you decide to see a Podiatrist, you are going to need the Birkenstocks. Go to a Birkenstock store, where they will fit you properly for your first pair. The model I wear is called "Florida." It has three adjustable straps across the top of the arch. These things are expensive (about $100) but they last many years and the pain relief will be incredible.
Custom orthotics crafted by a Podiatrist are really expensive. You might benefit from semi-custom orthotics where you stand barefoot on a diagnostic platform in a store and that reads out the orthotic that you need which you then pick up off a shelf. You've probably seen that TV commercial. I personally have not ever tried that. Email me with any additional questions.