HELP! counterstrike crashes

When im playing counterstrike and i join a server its all fine. But sometimes when i join another server either when i click the server or when it’s loading, counterstike will shut down and it will go right to my desktop, then when i try to join cs again it gives me that illegal operation sign and i have to restart. What should i do?