Making a on/off/restart button or switch

On Off switch both for power and program restart

What is the problem ?

Power the Arduino from an external source and connect it via a switch

There you are. An On Off switch both for power and program restart