I googled about this and didn't find any solutions because it needs user interact to do it, but is there any way to switch the keyboard layout using C# (MVC or Core) from Arabic to English and vice versa even if I force the user to refresh the page?
This will most certainly not be possible, since Asp.Net is a serverside language.
You can also not achieve this using javascript, as stated in this post, so you need to capture the keydown event and manually replace it.
But the easiest way would probably be to advice your user to change his layout, since replacing it can be very very tricky.