Because you were married for some time in 2021, you may file a joint return for the year for you and your deceased spouse, provided you did not remarry before the end of 2021. If there is an executor or estate representative other than yourself, that representative must agree to the joint return.