I'm looking for recommendations for a small gun. I'm looking for something pocketable and at an affordable price ($300 max). I know that locks me out of cool fancy shit but I honestly don't care since I only plan on using it for rare range visits. I've had people recommend me some small .38 or .22 revolvers. I only plan on keeping it for home defense or the rare instances I feel I need to carry.
a used S&W model 60 in .38 special can be had for around that. small guns you'll want steel frames to tame recoil and not hate it every time you put rounds down range. stick with easily affordable ammunition like 9mm or .38 or what's available and you can drop some money on a hundred or so every year to practice. new in this category can be a Armscor / Rock Island M200, philippino made and a working man's revolver, about the cheapest new in box you can find that isn't trash and you can actually rely on. it'll have a pretty bad DA trigger though.
remember your use case: this is a defensive handgun for use primarily in the home and for personal defense. being spend thrift is one thing, but buying without the input of a knowledgeable friend or buying a trusted brand a used gun, or buying a used gun from someone you trust to not sell you a lemon (maybe a friend has a reliable tisas 1911 that he doesn't jive with, or someone hates a beat up Kahr 9's snappy recoil and these guys have a provably working and decent gun they'll take a small loss on for a friend that has needs). for new, i agree with
@Glock 19 Gen 5 that a Taurus G2C might work for you, but check function in your hands - lots of issues with feeding specifically because the feed ramp is quite steep, like the Beretta M80 or some Astra pistols. failure to extract is common if you don't stick with 115gr "target" ball ammo. the trigger feels like a wet noodle, so you might consider an aftermarket "keep tinkering" trigger to tighten it up.
while the gun is cheap i kind of don't recommend the SCCY .380's or the Bersa Thunders - they work but the price of ammo and the small, slim size, make practice for many people a hated activity. a Phoenix Arms pistol is a time bomb, Hi Point is okay but probably too big for your situation, and i'd recommend against the Taurus spectrum 380 due to documented FTF issues with common ammo. Keltec P17 is cheap and mostly works but there's better out there.
but seriously, there's good S&W used k frame and j frames floating around, sometimes for quite cheap like the model 36, 60, model 10 and 15, and so forth. even the model 642 if you're into torturing your knuckles.
police trade in Glocks show up frequently and while they might not be compact and you might not like Glocks, it'll go bang and you can deal with an in waist band holster or something easily enough i'm sure. many police trade-ins are carried/practiced with, but rarely shot otherwise or abused. same with police trade in shotguns. inspect where possible, but generally they're alright.