First of all, don't listen to Che
There are of course a lot of factors, but I will leave player patterns reading, stats etc. and try to analyse only the ranges that are kind of starting point for me. Normally people open 2.5 - 3BB, so I am assuming that we are talking about such open, but of course if it is smaller or bigger, you have to adjust (my range will be tighter, when somebody opens 4-5BB, because odds are not that good anymore).
In general you want to mix your top hands with some bluffs, preferably suited and connected hands and call with other middling hands. You also want to 3bet more when facing an open from cut off or button, because they will open pretty wide.
In SB I tend to 3bet or fold my whole range vs late positions like CO or BTN (my range, not all hands, so: all pocket pairs, suited broadway cards, suited connectors, even as low as 67s), because stealing is much more probable and I am not getting very good price to call. The earlier the open is, the tighter my range is with less hands 3betting and more calling. Vs UTG I will 3bet only premium hands like AA, KK, AKs, AQs and some bluffs like T9s, 98s and call with high preferably suited cards and pocket pairs like 77+ or 88+. Then the later the villlain position is, the more hands I add to that range.
In BB I have much better price to call, so I will call with most of my range for each position (this is important: not most of the hands, but most of the range) and my range there is pretty wide. Vs villain on SB open it is like wild 70-80% range with same strategy of 3betting (strong hands for value + weaker suited connectors for bluff). Because the range is so wide, most hands are calls (I want to balance value and bluffs, to not bluff too much). The earlier the position, the tighter the range will be to probably like 30-40% max vs UTG and somewhere between for other positions (still calling with most of the range).
The important thing to remember here is that when defending, you will have to give up often, but when you hit a hand, your implied odds are sky rocketing imho
There is of course much more to it, because a lot depends on the table dynamics. When I play micro stakes (which I mostly do) the games are passive, so I can play wide and be more aggressive, but when there is a lot of 3betting and aggression, I will play tighter. Ranges I use are mostly based on various books and online courses. They work for me, but this is always debatable, so just try to get some starting point and then see what works for you.
P.S. Despite some opinions on the forum, it is important to work on your preflop game and it is something that you can learn off the table much easier than postflop game. The ranges can be very specific preflop and it is worth putting some time and thoughts into it. For me it was a game changer.