The Arduino can not produce a sine wave on a pin.
You should Google PWM to see what it is all about.
A square wave can be made by toggling an output pin with equal HIGH and LOW periods.
You are jumping in to this without paying your dues, go thru the examples in the IDE.