Thanks to @alecxs I was able to fix it. The reason why I was stuck in twrp is because I wiped system through twrp(I was frustrated when I couldn't boot in magisk after many times of trying so I decided to let the System go, the first time trying to root an phone so I didn't know what I was doing).
DON'T WIPE THE SYSTEM!
I still don't know why "Zip file is corrupt" ocurred, maybe because I tried to install magisk through sd card and the sd card was corrupted, or maybe because the twrp I flashed was unofficial, I don't know, but here is how you can recover your phone back:
1.Install the stock rom/firmware for your model at samfw.com,
before you install the stock rom for your phone model you should know your phone CSC(Country Specific Code), if you don't know it just boot in download mode and you will see Carrier ID associated with phone CSC Code
2.Boot in download mode and flash the downloaded rom. If that goes well and now you have your phone back but you still want to root then go to Magisk Installation Guide and follow the instructions.
If you experienced the same error like mine while trying to flash magisk on twrp with sd card then next time instead of sd card try to copy magisk in cache partition and then in twrp flash from there.