Be funny, but don't act like a complete idiot. The class clown is usually a pretty popular kid, as is the prankster who's always making people laugh. Being genuinely funny is a hard thing to do, but it's an important part of getting other people to like you. Act funny and go with the joke the other person says. And don't constantly joke around or do pranks or the other person will get annoyed, bored, or frustrated with the pranks you are doing.
Remember one rule: People are interested in themselves. The first step of getting people to like you is simple. All you have to do is be interested in them. Talk to people about themselves. Lead the conversation, making sure that it stays about them and they believe that they're the one in charge.