To trade manually (ie to have both people show the offered pokemon before the trade is agreed upon) you need to ask people on PSS to trade with you. You can do this with anyone, even passerbys, but they are allowed to ignore you at their leisure.
Another option is to use the GTS, this is where you offer a pokemon you want to trade, and then ask for a specific pokemon in return (barring special pokemon like Mew or events). If someone else takes you up on your offer, then the trade will be completed even if your system is off since it's done over Nintendo's servers. The only qualifications you can specify is the species, gender (if it has one) and level of the pokemon you want. You cannot guarantee someone will trade you something with egg moves for instance.
The third option for trade is likely what you did: Wonder Trade. This trading is entirely random, the only control factor you have is what pokemon you are sending out. The pokemon you get in return is based on the other person but oftentimes people send out breeding rejects or common pokemon that have no worth. It's all in the luck of the draw and it's not really a serious trading option, although personally I have gotten lucky by getting a few legendaries out of it somehow.