Direction sensors

Hello, I'm new to Arduino and recently started to learn the coding.
Currently working on a device to help my friend with special needs, walk straight by sending an alert when the direction is deviated (right or left).
Please suggest which sensors would be most suitable for this

A compass module (magnetometer) might work if the compass is carefully calibrated and used in an environment free of stray magnetic fields.

A gyro comes to mind, but the normal erratic movement of a human body when walking may be too much to deduce whether the general direction has changed.