Back when I last worked in a cubicle environment (2010), I found that ear buds (PK2) worked well for me. The music was not audible to my neighbors. I was isolated well from normal room noise and yet could easily deal when somebody wanted my attention.
Edit: Please note that I had music playing all the time.