Masks offer some protection to you and are also meant to protect those around you, in case you are unknowingly infected with the virus that causes COVID-19. How well it protects you from breathing in the virus likely depends on the fabrics used and how your mask is made (e.g. the type of fabric, the number of layers of fabric, how well the mask fits).
If you are asked to quarantine, it is because you have been in close contact with a person with COVID-19, which places you at increased risk of developing infection (including asymptomatic infection) and spreading the infection to others. You should stay home for 14 days after your last close contact with a person who has COVID-19. A negative test for COVID-19 during quarantine does not mean you can end quarantine early.