@Jinyu Shao
First of all, focusing on, "It's currently being rented out, although not generating much return." Unless you have an amazing relationship with your tenant, do yourself (them, and all the buyer's agents and buyers who walk through the property) a favor and make sure your tenant has moved out, fix and re-paint as needed, then tastefully stage the property. As a long-time landlord, trust me, you will thank me for this later.
As for your list of questions, see my answers below, next to each:
I'm currently living and working abroad and go back to visit 1-2 times per year. I'm trying to find out whether this is feasible in this situation. Always feasible to sell in your absence, but who will be conducting showings? I hope you are not depending on your tenants doing all that needs to be done prior to each showing? You want to make it as easy as possible for buyer's and their agents to schedule and show your property. Any issues with this will only reduce your buyer's pool and make it a longer sales process.
1) Can I represent myself to sell my co-op in NYC? (I know it's possible in some states, not sure if it's the same in NYC) As was stated by another member above, yes, always, but the question is how much will doing this cost you by not using a seasoned agent who really understands the process - start to finish - how to deal with buyer's agents, uses a showing service and an electronic contracts system, never-mind the issues you create for yourself by not listing the property as vacant and staged properly.
2) Can I do so while residing and working in a different country? (I can fly back for closing or other events that requires my presence) Sure, as long as you observe the above issues and make sure all these steps are observed and items are properly dealt with. Otherwise, it will be a miracle to have this work out the way you intend.
3) If both of the above are okay, when do I need to be physically present? Again, if you handle the above issues through others, you never have to show up physically. You can close the transaction remotely via a Fed-Ex package or other overnight carrier, or perhaps a mobile notary or equivalent (maybe a bank where you reside?) or via electronic contracts software, using a listing agent, or an attorney, or not (on both) and just depend on your chosen title company to close it, which they will, but if you have any issues or problems, who will solve them? Most of the work on any purchase contract is done long before the close date, but what happens if there are issues just before close, or during the close? Not too likely, but who handles in your absence?
4) Once I take the class online and pass the exam, what's next before I can represent myself to sell my property? It may not be as simple as you think from a cost perspective. You may well be able to take and pass the exams after passing the requisite course material, but it costs in several ways to maintain a license. You will incur up-front and monthly, or other periodic fees to get your license (after paying for the education and exams) and you will have to "hang your license" with an employing broker, which will also cost you monthly or periodically to keep it in good standing. Plus, you will need to decide whether or not to become a board member Realtor, which also costs annually at minimum. Finally, to maintain an active license, you need E & O Insurance, which is another $200-$300 per year on top of the above. Unless your intent is to make your living as a licensed agent (Realtor or just Real Estate Agent), do yourself a favor and just don't. Oh, and let's not forget about the ongoing "continuing education" credits you need to amass before renewing your license (assuming you become a "Realtor").
If your primary motivation for getting a license is to save money selling your own home, it is totally unnecessary, but you should observe the necessary steps required and market rules for selling, whether via an agent, or yourself. It's all about processes, procedures and a bunch of experience to get your property sold, which a good agent makes it seem easy. Unfortunately, unless you have been a real estate practitioner, and a good one, you don't know what you don't know, which makes a conversation like this incredibly difficult to understand from a layman's perspective. Some things you just have to stipulate are true and trust in others to assist. This is one of those things.
You need help selling your property if you wish to get the largest offer in the shortest amount of time. If you choose to venture out on your own, it will cost you dearly. Best of luck!