I would like to ask how to design a digital filter to remove $50$ Hz interference on an ECG signal. Do I need to use notch filter? Thanks.
Yes, you will need to make a 50Hz notch filter.
I would suggest you to look at this post.
If you tell what type of program you use (Python, R, etc) I could try to provide you some code aswell.
One paper that everybody starts with for ECG is Pan and Tompkins. Wikipedia page is here. They use a low pass filter with cutoff frequency of 11Hz followed by a high pass filter with cutoff of 5 Hz. The lowpass will remove 50 Hz noise.
 Pan, Jiapu; Tompkins, Willis J. (March 1985). "A Real-Time QRS Detection Algorithm". IEEE Transactions on Biomedical Engineering. BME-32 (3): 230–236.
The only thing to be careful with is initial conditions of the lowpass filter. You'll want to load x (1 to 12 or 0:11) with zeros and y(1:2 or 0:1) with zeros.