Answer: by protecting yourself (mask and gloves), ventilating the room and washing the floor after removing the adhesive residue, possibly using an electric heat gun.
To remove glue residue after removing an old carpet, dedicated strippers for carpet glue are commercially available, especially from large DIY stores. It will be necessary to check on the packaging of the product that it corresponds well to this use, or inquire with a seller. These products are generally irritating and even toxic, so you should absolutely work with a mask and protective gloves. In addition, they emit smoke harmful to health, remember to ventilate the room well before stripping. Once the glue residue has been removed, wash your floor with soapy water to remove the chemicals. You can also remove the glue using an electric heat gun.