how to generate arduino Ding Dong sound by 4ohms 3w speaker
What have you researched ?
All I know is some basic DC electronics. Putting 3W into a load at 5V requires 600 mA. Arduino pins can only drive 40 mA so you will need a transistor to drive the speaker. I think 5V directly into a 4 Ohm speaker will be too much current (1250 mA). I think that means you need a roughly 4.33 Ohm resistor in series with the speaker to avoid frying the speaker.
Use tone() to play tones.