You should just listen to your body and sleep
in a comfortable position.
Your doc and/or physical therapist
may have some more specific suggestions depending on the specifics of your injury but comfort is a good guide. (most will find laying on their back with their arm resting on a pillow. Some, who cannot sleep on their back, find using a recliner and pillow to work well.).
Answer assisted by David Miller, Medical Student