To avoid accidentally disconnecting from a League of Legends game, make sure your computer's power settings are adjusted to prevent it from entering sleep mode or turning off the screen while you're playing. Additionally, ensure that your internet connection is stable and not prone to frequent drops. If you're experiencing issues with disconnecting during games, you may also want to check for any background processes or applications that could be interfering with your connection. Finally, keeping your game client and drivers up to date can help prevent technical issues that might lead to disconnections.