El servicio militar es obligatorio en mi país, pero aquí en este país es voluntario.Military service is mandatory in my country, but here in this country it is voluntary.
Tras años de tratar de dejar el cigarillo porque sus amigos se lo pidieron, decidió dejarlo voluntario.After years of trying to quit because his friends asked him, he decided to quit smoking voluntarily.
This means that the noun can be masculine or feminine, depending on the gender of person it refers to (e.g. el doctor, la doctora).
Los martes trabajo como voluntario en una organización de ayuda a inmigrantes.On Tuesdays I work as a volunteer at an organization that helps immigrants.