Here is David performing the ‘figure 4’ stretch to isolate the piriformis muscle. To enhance this stretch use a table and put your leg on table and lean over the leg, applying the same principle.
If when you lie down and notice the one foot is slightly externally rotated 9/10 times you have a tight piriformis on the side that is more externally rotated.