I had selective mutism when I was in kindergarten. An embarrassing first day caused me to be mute almost the whole year of kindergarten until the day that I forgot my backpack from inside my paternal grandpa's car. I was compelled to tell my teacher out loud with my classmates present before I walked outside my classroom to my paternal grandpa's car to retrieve my backpack. From then on, I continued to speak out loud because my teacher and classmates heard me speak that day. Before that event I whispered my answer to my teacher when she asked me a question or nodded or shook my head or pointed. After kindergarten I still rarely spoke when I wanted something. I would only speak if someone asked me a question. I wouldn't comment or ask questions for others to answer. I only said, "Yes" or "No" when someone asked me a question. When someone asked me an open ended question, I answered with as few words as I could. However, as long as I can remember I was always talkative and animated at home and in public outside of school with people I was close with. I still have social anxiety, not the disorder because I don't experience panic attacks. I still don't answer questions that professors ask my classmates and me to answer by raising our hands to speak or speaking without raising our hands unless I'm confident with my answer or the number of people in the class is small. If I have to discuss a subject within a group, I let other people talk and only speak if someone directly asks me a question or asks me to talk or I'm confident with an answer. I can behave and talk naturally when I'm comfortable in a social situation. In contrast, when I feel uncomfortable my body tenses and becomes stiff, my facial expression is emotionless, my voice is in a monotone, my throat is dry, I sometimes sweat, my heart beats rapidly, my mind goes blank so I can't form an answer or I use simple vocabulary and sentence structures as opposed to complex ones, sounding dumb instead of eloquent.
Meditating, exercising, feeling good, feeling excited about something, writing down all the things I'm proud of having done or the good things I did for today or yesterday, writing down what I'm grateful for, engaging in hobbies, being with nature, listening to music, reading a book for leisure, doing something and being in the moment such as washing dishes, cleaning the car, folding clothes, eating, drinking tea, juice, or a smoothie, walking, observing the sky, stars, moon, or clouds, etc. helps with feeling comfortable before a social situation.
To separate yourself from your thoughts, focus on your surroundings and people. Look at them, paying attention to their sights, color, texture, scents, sounds, think about their tactile qualities.
To have something to say after someone talks, pay attention to what the person has said so you can ask a question or comment by making associations from what the person said.
From my personal experience, if you, a child you know, or an adult you know has selective mutism, to force the person to talk, he or she has to be in a situation where it is an emergency or he or she is in danger or someone else is in danger and the only option is to speak to save the person. Examples: Yell at someone to wake up if there's a fire, yell at someone to run away, warn someone if there's a shooter or bomb, tell someone that you forgot something and need to go get it, ask for help, get someone's attention.