Default Installing rom on phone

Hello, i have an htc one with network problems and wish to reload stock ROM on it....can someone explain how to do it? Do i need to unlock bootloader and root the phone first, i know how to do that? Also, where to get latest ROM from? ALso i wish to format the phone and then load the ROM, can anyone help me out? Thanks.