Tried it but after the first command it says that "can't open '/dev/block/platform/msm_sdcc.1/by-name/fota': no such file or directory exists" what should i do
At a quick glance it appears you put a space between the . and 1, try it without that space.
If you get into a recovery boot loop (where the phone keeps booting into the recovery, and not the OS), this will fix it without losing any data. (NO FACTORY RESET NEEDED)
Go to TWRP recovery terminal commands, and enter the following:
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota
PRESS ENTER
THEN TYPE
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/misc
THEN PRESS ENTER
REBOOT
This should boot up your phone without any changes.
This help me a lot a while back when I was sick with no os on a phonei have everything working against me. I have a mac and I've never side loaded so i have been researching and downloaded a Mac version Android SDK Manager and I am completely lost.