As long as the game has online functionality you're set. Which in this day and age, any game that lends itself to versus play is practically required to be playable online, or no one would buy it.
As for the PS3 itself, all you have to do is connect it to the internet by plugging in an ethernet cable if you have a wired connection, or messing with the WiFi connection settings if you have wireless internet. The WiFi receiver for the PS3 is built in, so there's nothing extra to buy. Once you do that, sign up for a free PSN ID by going to the Playstation Store on the console's dashboard. After you do that, make sure you update your console's firmware to the latest version if it doesn't already make you do that as part of the process, and you're set. All you have to do after that is go into the multiplayer mode in your game and jump into an online match.