Search the net for reviews of guns which interest you. While I believe more buyers will post negative experiences, their poor experiences wil at least provide you with some general expectation of reliability. Please do not, as I did, ignore the preponderance of bad experiences and expect to "get a good one".
While it is true that you get what you pay for, even the high dollar manufacturers can produce questionable quality firearms.
But, help us help you: are you limited to semi-autos? a particular calibre? finish?