I can't go anywhere for 10 days to prevent spreading the disease/infection to others.
I'm quarantined for 10 days.
I can't go anywhere for 10 days to prevent catching the disease/infection.
「感染予防」だけで、誰から誰にの感染を予防しないといけないかは明白では無いですが、英語でそれをはっきり言わないといけません。
自分が感染している可能性があり、他の人に感染しないために外出しない時は以下の例文です。
I can't go anywhere for 10 days to prevent spreading the disease/infection to others.
他の人に感染しないように、10日間外出できません。
「Quarantine」というのも使えます。「自己隔離」です。
I'm quarantined for 10 days.
10日間、自己隔離しないといけません。
なんだかの理由で自分の免疫力が低下していて、感染するのが危険な場合は以下の例文です。
I can't go anywhere for 10 days to prevent catching diseases/getting infected.
感染しないように、10日間外出できません。