You can flash stock ROM via mi flash tool..
For complete step to step installation method you can go here - https://www.miuithemez.com/2019/06/how-to-flash-stock-rom-on-redmi-note-4-fastboot-method.html
You can also select whether you want to lock your bootloader or not. And also, you can...