How to output a square wave clock in the MHz range

See the edit of my previous post. It is for ATmega328P and similar - Arduino UNO and Nano.