Wal-Mart bikes can be a fine fit. It's just that the moving parts wear out quickly (100-500 miles vs 1000-5000 miles).
There are a lot of systems for bike fit, but mostly, it's about what feels comfy.
1) Start with a big, squishy seat (saddle). Sunlite has a "Cloud 9" brand for $20 that is awesome. The less you "sit" on it, the less support and padding you need, but start big. Basically, your squishy bits shouldn't hurt after your longest ride, but your butt-bones probably will.
2) If you slide off the front of the seat, you should not crack your pelvis. If you don't have some room there, the bike frame is too tall for you.
3) The seat should be high enough that while sitting on it, you can touch one but not both feet to the ground.
4) The seat post should have at least 4" inserted in the frame to do #3, or your frame will break. Longer seat posts are $10.
5) With the pedal all the way down, your knee should be almost but not entirely straight.
6) The distance from the seat clamp to the handle-bar clamp should be 2/3 - 3/4 of your height minus your inseam. Inseam is crotch to floor while barefoot.
7) Minor adjustments can be made with seat & post, handlebars and stem, etc. Basically, you shouldn't put a ton of weight on the handlebars, or your hands get sore or numb.
Bike costs vary substantially:
If you like tinkering, repairs with upgrades will put you ahead of the game. A $90 bike would take around $400 over the course of a year to become a solid, long-life bike with great components.
If you don't like tinkering, then Bikes Direct can set you up for $700, and you'll spend maybe $150 over the course of a year for it to be solid with really good components.
If you hate tinkering, then a local bike shop can set you up for $900 for acceptable components, and you can spend $200+ per year having them maintain it for you.
Parts is Parts:
For longevity, sealed bearings are what you want. Cranks should be a cartridge, not loose bearings with a shiny steel plate holding them in. Wheels should be quick-release, otherwise they will have loose bearings inside. All of this can be replaced/upgraded along the way, or even repaired. (Great bearings, grease, and races can be had for about $12 per set - or sealed cartridges in the $30 range that last 5000 miles.)
7/14/21 speed chains are heavy duty and last longer. However, shifting the front gears can be a pain sometimes. The 9-11 speed chains are easy to break, though SRAM chains are best. (Use the size of chain your actual gears.)
Changing the number of gears on your bike is a major undertaking. Expect to replace shifter levers, the actual mechanism/arms (derailleurs), maybe the cables, as well as the hub/wheel. There are several systems from each manufacturer and many of them are not interchangeable. Getting a mismatch means you might drop the chain, wedge the chain, or keep auto-shifting between gears. As such, stick with the # it came with unless you're building a whole new bike on a frame you really love.
Go for the cheap tubes. Kenda/Q-Tubes/Summit are great. They stay inflated longer. Puncture resistant suck and are heavy and slow. Presta tubes are weird, and need a special pump. They also don't go flat at the end of the week.
Tires matter. Crappy tires will puncture easy and roll very slowly. Continental, Vittoria and Ritchey tires are worth the money because they get fewer flats. Wider tires are easier to inflate and softer on bumps. Thinner tires are easier to pedal and go faster on smooth pavement. Knobby tires are only good for mud and rocks. The less tread in the center, the better. Even slicks have more grip than you'd think. If you have to hit sand, then something smooth in the middle with bumps on the edges works well.
Wheels only matter a little. The main wheels are called a bunch of things, but really they are 700c (622mm) (27" to 29" wheels), 650b (584mm) (26.5 or 26" wheels), or 26" (559mm) wheels. Smaller wheels go a little slower and ride a little harder, but mostly, the wheel size ties to the frame size. Whatever of these three come with a bike that fits you are fine, but the 559 and 622 are easiest to come by.
Cars won't see you, especially at intersections. Be on the look out. Use lots of flashy lights.
ALWAYS WEAR A HELMET even if it messes up your hair. If you fall and bonk your head on the curb, your brains get scrambled. Helmet is important. Snug, but not tight. Strap should keep the helmet on your head when you fall.
Frames are the #1 way to spend too much money. A $90 complete bike from Wal-Mart has the same quality frame as a $150 internet frame. A $1000 frame is probably worth 5% speed difference. A $10000 frame is worth probably 6% over the Wal-Mart bike, but it also will have some cool features, like integrated sensor mounts, etc. Mostly it will have some cool manufacturing technology, or the blessing of wood elves, or a custom paint job, or whatnot. If you want to spend that much, then have one made by hand by an artisan to your exact physiology.
Suspension is great if you ride down mountains, but just slows you down on streets and sidewalks. 30 pounds vs 20 pounds matters if you're going up a lot of hills, but you'll change more than that in your own body weight throughout a month. Steel vs aluminum vs plastic doesn't matter much either until you're riding 30+ miles or racing.
Quality of mechanics DO matter for comfort and reliability. When things wear out, you can replace them with better quality parts. 5xxx to 7xxx series Shimano parts are great. Above that only for racers. Below that is okay if you ride less than 5 miles at a time, but expect to drop the chain from time to time.
Consider parts to be around $10 times the series number for Shimano gear. SRAM comparisons vary, so search the web. Retail is 30-60% over internet, and internet is 30-60% over wholesale. The difference is the amount of service, advice, warranty, and similar you can get. If you pay retail but don't get the service, go somewhere else. There are plenty of great bike shops and resources around.
Road bikes, with drop bars, are magically more expensive. Only do this if you plan to ride 20+ miles in the wind more than twice a week. What would be a $35 shifter/brake lever on a flat handlebar would be a $200 device on drop-bars.
The difference between a $90 and a $9000 bike (not just frame) is about 30% speed. Unless you are training hard to earn the same out of yourself, don't listen to anyone who poo poos your $90 bike. Ride it and have a great time. Upgrade or replace only the things that bug you, and you'll have a much better time. Plus, if a $90 bike is stolen, you're only out $90 to replace it.
If you have comfort problems, find someone you trust, who isn't trying to sell you something. That might be a bike shop, or a friend, or a biking group. All of those might also lead you into the trap of having to "buy a better bike" or "buy this magic device" when really maybe you just need to tilt your seat or handle bars.