But the person is najis 40 days if he drink alcohol right? So can he fast and pray

He is not really najis. This is spiritual najasat.
He can't leave prayers and fasting.