This is half reverse engineering (understanding the existing part), and half engineering. The reversing can be quite difficult for less common parts/designs, and is partly a different skillset. But for standardized interfaces like an IR TV remote it can be pretty easy.