I don't think there is much you can do to prevent it.
Some flannelettes pill .......... and some do not!
And it seems that there is no true way to tell which ones will.
I have had expensive ones do it ... and not do it.
Likewise, I have had bargain basement ones that washed up fluffy as can be and never pilled.
While others were a pilly mess!