Yes, if you are exposed to a person who is actively suffering from an illness with COVID-19, you can contract the illness as the virus is mostly spread from person-to-person through respiratory droplets. This is why the CDC recommends that infected patients are isolated until they are better and no longer pose a risk of infecting others.
References:
1.https://www.cdc.gov/coronavirus/2019-ncov/faq.html#basics
2.https://www.who.int/news-room/q-a-detail/q-a-coronaviruses