Express JWT (Algorithms as an option)

How do I understand which algorithm is apt to be provided as an option in the expressJwt function ?
Last I used it I faced invalid algorithm error in my back-end. Need some insights on this.
Also , I was going through a StackOverflow post which said HS256 is less secure in comparison to RS256 but RS256 didn’t work in my case , HS256 did. Will this be a problem ?