You said in your question that he/she got a good opportunity.
If by opportunity you mean bigger salary, then you have to provide a counter offer.
If you mean higher position then you should think if you have any possibility to promote him in the near future and let him know.
The main idea is as him and know the reason he's leaving and the solution might be much easier than you think.
Good luck
Actually I will try my best to convince him to stay in my company .
If he still insists moving from my company I will investigate the causes of his moving and offer him a better environment in his work but not the extent that I loose any of my profit in the company so that to convince him to stay .
I can also think about another employee and compare between them and decide how to behave.