Getting published in a course-based grad program
The best way to get started doing research is to find an experienced advisor to guide you. Also, if you would like to apply to a PhD program, you will need strong recommendation letters from faculty who can speak to your ability to do research (and not just your ability to earn good grades in your coursework).

Talk to faculty in your department (ideally, those you've left a positive impression on as a student in their courses) about participating in their research.