Ear infection ?

Why does my baby sleep like this and constantly do this with her hair it’s like she’s pulling it ?