Replace the components by guiding the legs through the holes in the board. Bend the legs to the side to keep the component in place. Solder in the usual way.
After the component is properly solder to the board, cut the excessive length of the contacts with a pair of side cutters.
The only other thing I recommend is to either reflow, or resolder the flyback transformer contacts. The ones on this board looked like they may have gotten hot.