Well I don't know the Nokia phones, so don't know procedures for reflashing them. But if you've tried using an "unroot" option in SuperSU and the phone no longer boots then reflashing is probably your best bet.
If you have a custom recovery installed (I think it's hard to root without one these days) and took a backup using it before you tried to unroot then just restore the backup. If not, this is the golden rule of rooting: always take a recovery backup (aka "nandroid") before you make any changes to the system, however apparently trivial.
If you haven't, then I've been able to find out that the tool for flashing Nokia's is called "OST". There's a guide to downgrading from Android 8 to 7
here, which includes reflashing the ROM - you can skip the first bit, about copying some file to the SD card and using the bootloader to install it and skip to the bit about using OST (unless you have upgraded to Android 8 before doing this). The mega link seems to include all of the files, including both firmware files and the OST tool. However the instructions are pretty minimal, so you might want to do a bit of searching on the web to see whether you can find something else about this tool.
Note that firmware flashing like this on most phones will reset the phone, i.e. wipe all data. I don't know about the Nokia 5, but just warning you that this is likely.
If you have a custom recovery and someone else has saved a backup of the stock ROM using theirs and posted it then you might be able to restore that. I can't see any custom ROMs for this phone at XDA (which would be another option).
Please do as much reading as you need to feel confident you know what you are doing before attempting to reflash anything. I don't know how well protected Nokias are against attempts to flash incompatible firmware, but I do know that there is more than one model number of "Nokia 5", and do not know what the consequences of attempting the flash the wrong firmware would be (but if successful such things rarely end well).
I'd hope that someone who has experience of Nokia phones might read this and comment, but I can't think offhand of someone with that knowledge who I could tag here.