Well for starters, there might be something wrong with the driver for your modem or so the Application you are using for instant messenger, maybe removing and reinstalling it again - the Yahoo IM software wont hurt to try.
1. You can try to create a new user profile ( login in your system and try to connect with that ).
2. If you are using dial-up ( modem as you indicated not LAN card ) you can try to uninstall the drivers for it ( be sure to have the installer before doing this and reload again the driver.
3. you can either have it check if you are using DSL / Highspeed via your internet service provider they have sorts of diagnostic tools for that.