I’ll second most of the recommendations here:
Socket set in SAE and Metric
Wrenches in the same
A set of screw drivers (Phillips and Flathead, you want at least a standard length, long, and stubby in probably three tip sizes)
An Allen key set
Honestly, Home Depot has a 120pc husky mechanics set on sale for $100 for the holidays I recommend if you have nothing. It covers all of the basics, the quality is decent enough, and it’s cheaper than putting it together piecemeal even at harbor freight.
You’ll want a jack and stands as well, and if you plan to do oil changes probably ramps too (plus an oil drain pain and a storage container to store the used oil to take it back to the store for recycling).
For cars that will get you 95% of the way through most jobs. From there I recommend filling out additional tools as jobs require them.
For home improvement, add a hammer, some pliers (I’d get one of the triple sets that go on sale various places all the time).
For power tools I suggest you pick an ecosystem and stay in it. Milwaukee, Rigid, and Ryobi are all made by TTS and perform pretty similar for home users. I invested in Milwaukee but would easily recommend rigid as a solid middle brand with decent price to performance. Dewalt has a great reputation as well, with a large selection and sometimes the price to match. I also know plenty of folks that are happy with the Hercules battery tools from HF. I would stay away from craftsman/black & decker, and other budget brands from big box stores, if that’s your price range then just go with the similar priced HF tool. I suggest a drill and driver to start, then fill out tools as you need them for projects. I use my oscillating multi tools a tons as a good fit most great at none tool for cutting. A lot will depend on what work you need to do around your house (which you won’t really know until you buy a house).
I subscribe to Adam Savages methodology of buying cheap hand tools and replacing them with quality ones when they break (since that’s the sign you need a good version of it). I’ve found I still have a ton of cheap tools that work just fine.
Lastly, shop around. Don’t assume the Harbor Freight will be the best deal (they have the reputation of cheap stuff, but as their quality has started going up so have their prices). Look for sales and deals, and for sure shop the clearance aisles at the orange and blue stores. I also shop estate sales and moving sales where folks are looking to offload an entire garage worth of tools quick.
Edit to add: safety equipment is the one area I never compromise. Good eye and hearing protection is invaluable (you only have one set of eyes and ears, and both are fragile). I keep safety glasses in the basement and garage near all my power tools and mechanics toolbox so they are always close by. I also keep n95 masks for working in dusty areas like the attic. I hate gloves but keep a couple pairs for mechanic and outdoor work mostly. Glasses and ear plugs/muffs/active buds (isotunes, AirPods Pro, etc.) should be the first two things you get.