I'm not sure if you are looking for a third-party application to fill this void on your website, or if you are asking how you would create one yourself.
If looking to create one yourself, you need to break down the feature into more realistic parts, otherwise, you will constantly feel overwhelmed.
Example: Chatting (this is not a comprehensive list of parts)
- Need a minimal of 2 users
- Ability to Initiate a Chat
- View Messages from another User
- Send Messages to another User
- Friend List?
- Online Status Indicator?
- Formatting of Chat Messages?
- Logging/History of Chat Messages?
Then you need to take those parts and break them down again.
Example: Ability to Initiate a Chat
- Send Request to a specific or multiple users
- Allow request to be accepted
- Allow request to be rejected
- Establish communication line (ie: create a necessary table or other mechanism defining the chat -- making it a real object)