Well, generally one has to actually be knighted by royalty. To do so you generally have to do some act of valor or be greatly recognized in a manner that would make them consider knighting you.
Of course, our knights today are far different than the knights of a few centuries ago. More of an honorary title without much benefits other than a "sir" title being added to their name in mention.