You earn reputation on Stack Overflow by writing questions and answers that receive lots of upvotes. So, you should write lots of quality questions and answers. Also, if you answer questions that have a bounty on them you might be able to gain more reputation. Keep in mind that there’s a 200 rep limit per day, so getting to 200k will probably require a large investment of your time.
For more information about reputation, as well as what other actions gain you rep, check out this meta post.