How to create a 38 Khz pulse with arduino using timer or PWM?

Grumpy_Mike:

Also I understand pin 3 and pin 11 cannot be use for any other purpose

If that is what you understand then you are wrong.

Please explain. I am not an experienced coder.

I see in the comments that pin 11 is being disabled for the output that why i said i t is not available for use.
As for pin 3, i meant that since the 38 Khz wave will be available on that pin, it has been made use of.