Scared of rejection

There's this guy like, but I'm afraid of rejection. Should I tell him? What should I say to tell him?

Do guys like to be told that someone likes them?

I don't have his number, but I could DM him, or should it be in person.

I haven't really talked to him much so it would kind of be out of the blue. Is it weird to just randomly tell somebody that you like them?