It is not hard to replace an ecm, the trick is getting the correct one. you will need your vin possibly to get it. There is a possibility that you may have to take it to a dealer to get it to function afterwards. you may need numbers off of the old one too.
As you didn't state year and model some you can others require dealer reflashing.
Search Toyota Questions