To switch from a developer role to a Scrum Master role, you should start by deeply understanding the Scrum framework and its practices. You can do this by attending Scrum training courses, reading Scrum books, and participating in Scrum communities. Additionally, it would help if you tried to gain experience leading Scrum teams by volunteering to lead sprint planning meetings, daily stand-ups, and retrospectives. Further, you should develop your leadership, communication, and conflict-resolution skills. Finally, it would help if you looked for opportunities to become a Scrum Master within your current organization or by applying for Scrum Master positions at other companies.
Here is the list of training in order of recommendation :
Certified Scrum Master (CSM), helps you build a basic understanding of the scrum framework and the role of a scrum master.
Industry Enabled Scrum Master(IESM), helps you experience the day-to-day working of scrum master with tools like Jira.
ICAgile's Agile Team Facilitator (ICP-ATF) teaches you techniques to facilitate various scrum meetings. Meeting facilitation is one of the essential skills for a Scrum Master.