Fold your pillow in half, then let go.

If the pillow springs back, it’s in good shape.

If it just lays there bent like a soggy potato chip, get rid of it. It’s not worthy of supporting your head and neck adequately while you sleep.