I think I pulled a muscle in my shoulder. How do I know I pulled it and I do I treat it?

Muscle strain. Soft tissue pain is a pretty good indication, try an over the counter muscle rub and an over he counter anti-inflammatory like ibuprofen or naproxen, it that doesn’t work seek medical care .
Pulled muscle. A good exam can help figure this out. The shoulder can also be subject to tears of the rotator cuff which contains the tendons which insert into the shoulder.
Physical therapy is a great way to treat these. If it just happened and is acutely painful, I recommend resting it for a few weeks, then doing PT.