Get a new bike. You won’t be able to tell what’s wrong with a used one and you might end up shelling out more than you need to if you find anything wrong with it.
Read up on bikes and listen to some podcasts. Bikeradar and Global Cycling Network have really good content that you can use to educate yourself on everything from frame materials to the drivetrain and tires and brakes.
Mountain bikes are heavier because they have shock absorption and fatter tires. Hybrid bikes have decent tires and can work great for commuting. Road bikes are generally for going fast. Do your research.
Don’t turn up your nose on the smaller brands. They usually get shit on by people on the internet because most people who love to talk about bikes are enthusiasts and have different needs. They might well have the perfect bike for your purposes.
I think a lot would depend on what's your style, where are you going to be cycling? There are some general categories like commuter, mountain, road, recently more popular gravel which now days are more like mountain bikes from 90's. Most important is to start riding wherever you are, whenever you have time. Pick something you can afford and won't break your heart if you drop it (like 10K super bike).
I'd like to add that I personally think a mountainbike is a great starter. It's not the fastest bike you can get but the big tires are more forgiving with obstacles which is great especially for beginners. The slimmer your tire is the more attention you have to pay to the road. On a race bike you can't zone out during the ride.The downside is that you're lacking the capacity to carry a lot of weight comfortably so if you plan to do that go for a bike that's more focused on comfort.
If you can have a local and handy friend who cycles help, picking something up from facebook marketplace or Craigslist is the best way to get started. As long as the bike is mechanically sound and you don't grossly overpay, you can usually resell a bike with little or no loss in a year or two should you decide it wasn't the best fit/option.
If that isn't possible, buying from a shop is also fine - it will just cost more and you will lose a bit more money if you decide to offload the bike. The benefit would be having a shop for questions, and many will include free tune ups for a period of time after purchase which can be worth it.
You mentioned just getting into cycling but haven't said much about terrain. If you expect to stay on the road or paths, a flat-bar hybrid is probably the most versatile first bike. A mountain bike (accepts chunkier tires, frame is more slack, usually geared lower) would also be ok, but maybe not ideal unless you expect to be off-road at some point. I would probably steer you away from a road race setup (drop/curly bars) if you are just getting started as they tend to be less versatile unless you get something beefy and gravel oriented. Once you figure out where you will cycle and what style bike you want then spend the money to get a more targeted setup (ie road race, touring, gravel, mountain, etc).
Stick with the big names if you buy used - Trek, Giant/Liv, Specialized, Cannondale, etc (not an exhaustive list) instead of Walmart or box store brands. The big brands are more likely to be repairable and sometimes shops won't work on box store bikes.
This is a expansive and complicated topic, any additional information you can provide will help us in assisting you.