Well first what messenger do you have? Do you have a BETA version or an older version? Is there any dodgy viruses or programs that could stop your messenger from working? Do you have wireless, because wireless can sometimes dissconnect it. Lastly do you have any error messages coming up if so please post what the code is
EDIT: also sorry I didn't say this earlier but do you have any add ons installed like SimleyCentral, SweetIM etc?