You can mute everyone at the start of the game or you can resize/move the chat such that you can't see it well anymore and it should stay that way, if you think you will forget to mute people.
If you have a high end keyboard you can use the program that comes with the keyboard to rebind the enter key to act as some other key.
You can invest in the following object
https://www.amazon.com/dp/B00M9ETHYU/
and use this to physically remove the enter key.
Lastly and this is a dangerous choice as it may or may not violate riots 3rd party program section. you can create a program using python or autoit that will disable/rebind the key while the program is running. there may be other programming languages you can do this in, but those are the only two I know how to program in and have used to tamper with keybindings for non-gaming purposes in the past.
But the above mentioned things should only be used as a temporary solution because the best choice is to try to find the means to learn self-control. Some examples being, via breathing exercises, Meditation, finding a professional to help you. I am going to be honest. If you really don't have the self-control to be able to control what buttons you press on a keyboard. You might need to talk to a professional about the situation. Because if you can't control yourself with something as simple as pressing keys on a keyboard. I start to wonder what else you can't control to well.