I Seriously need help!

hi everyone my gmod is getting annoying i can play it for like 10 min it runs smooth as anything no lag or nothing but then…
it says something about connect:connect
and sometimes it would just exit to the main menu all the sudden plz ******** help!