Let's say we have a flat object. We are asked to create some mechanism so that the part can rotate in the shown angles above. What mechanisms can be used?
Gimbals are the classic solution for this: https://en.wikipedia.org/wiki/Gimbal And if you don't need any roll, you can omit one of the gimbal rings, in which case a pan/tilt mechanism is sufficient (often sold for photography.) You might look for a gimballed gyroscope toy and start with that. (Flight quality gimbals are expensive.)
You can mount your head part on a neck globe with two pins protruding out and screw that into a sphere socket like a kids doll neck.
This spherical socket is threaded in a pitch that spirals around the sphere with the slope of 30 degrees over a half a turn and the two pins slide back and forth in this thread.