How to remove switching transients at digital pin of PIC 16F877A microcontroller.Please suggest something worthy.Very noisy environment of High Voltage
An EMI filter to reduce the bandwidth of the signal, and a series resistor to reduce the amount of energy.
You forgot to mention if you meant an input or an output pin. You also forgot to mention the toggle frequency you need or the required rise and fall times. And any requirements for drive capacity.
High Voltage normally doesn't matter so much - high switching currents are normally a bigger problem.
You might need to add some clamping device on the signals too, if it can be assumed that they may receive negative voltages or voltages above VCC of your processor.
Always tell the whole story!