united-states
Suppose my employer wants me to do something unethical. I refuse, they
insist, and I resign in response. There is a notice period, however.
What happens during that notice period? Am I still obliged to do the
thing which I consider unethical?
An employee can resign at any time without notice due to the prohibition on slavery or involuntary servitude under the 13th Amendment to the United States Constitution, without criminal penalties or civil fines/penalties.
There are very limited exceptions to this rule for, for example, military personnel, paramilitary CDC employees, and people sentenced to work for as punishment for a crime in some states. There is also an exception for people who are responsible for other vulnerable people, such as babysitters in custody of small children or doctors or nurses in the middle of a surgery, until that responsibility for the vulnerable people can be handed off to someone else.
If the employee resigns when there is a contractual agreement to give notice, but not a specifically enforceable duty to continue working (which exists only in the rare exception cases), any penalty for leaving prior to the contractually specified notice period (which usually doesn't exist at all in the predominant case of "at will" employment) is limited the compensatory monetary damages for the economic harm caused to the employer by the early departure.
If the employee agrees to continue working while doing everything that the employee don't consider to be unethical for the balance of a contractually provided notice period, this will reduce the amount of compensatory economic damages that the employee could be sued by the employer for, for breaching the notice provision of the contract, but most likely not entirely to zero.
If the employer refuses to accept this offer from the employee, this may still reduce the amount of damages that the employer can recover by the amount its economic damages would have been reduced if it did accept the employee's offer, because the employer had an opportunity to minimize the employer's damages and didn't utilize it, breaching the employer's duty under contract law to mitigate its own damages.
As a practical matter, employers almost never sue an employee for money damages for resigning without giving a contractually specified notice except in the case of basically irreplaceable, high value employees like a headline performer on a concert tour, a lead actor in an almost finished movie, or a senior executive, scientist, or engineer who is the only one with the skills necessary to conduct the company's business in the short run, and then, only if there is a written contract specifying that requirement and the penalties for failing to do so.
An employee's failure to perform conduct required by the employer that is legal, but which the employee personally believes to be unethical, however, is not a constructive discharge from employment. So, if the employee resigns for these reasons, the employee will not be eligible for unemployment benefits (the analysis in Montana, which does not have "at will" employment, is slightly different, but basically leads to the same place in the end).
Of course, if the employer insists that the employee do something that is actually illegal and not just unethical, then the employee can refuse to do so (and must to be free of legal liability) immediately. If employee is fired for refusing to do this, this is a wrongful termination that gives rise to a claim for damages by the employee, and if the employer insists on continuing illegal conduct this is a constructive discharge even if it takes the form of a resignation, and this can be done without penalty or breaching any valid portions of an employment contract (apart from the rare exception cases described above, where a different analysis applies).