What should I do if my parents ask me to do things that contradict Allah's commands, possibly leading to sin? Should I always obey them in both religious and non-religious matters, even when I know what is right?
You have to always keep the respect of your parents but not obey any order which is against the orders of Allah (SWT). The Prophet Muhammad (SAWA) said: No obedience to any creature in the disobedience of The Creator. If you are sure that the order given to you by your parents leads to sinful act, then you must refrain from committing sins.
Wassalam.