How do you get surf HM?

go to petalburg and defeat the 5th gym leader. go to Wally's house - beside the gym and talk with Wally's uncle.

or if you are talking about firered, you have to go to the safari zone. at the end of the safari zone, you will encounter a special house that looks similar to the one when you first walk in the safari zone, when you go in ,there is a man there, talk to him and he will give you HM surf