it will depend on equation of displacement. velocity equation will be its derivative function. You can also find displacement function using the initial position, where from the oscillation is started. if it started from mean position, displacement will be in sin so velocity is in cos(also we can change this sin (θ ) to cos by cos (π /2 - θ)). also if started from one end then displacement is in cos, so velocity will be in cos. it is best to check this position . you can just take derivative of displacement equation for finding velocity equation.