There are several ways to get rid of cooking smells from garlic and onion:
Boil a pot of water with lemon, cinnamon, or vinegar to neutralize the odor.
Leave a bowl of activated charcoal or baking soda in the kitchen overnight to absorb the smells.
Burn a scented candle or essential oils to mask the smell.
Use a kitchen exhaust fan or open windows to ventilate the kitchen.
Clean surfaces, floor and appliances with a mixture of water and white vinegar to neutralize the odor.
Boil some lemongrass or lemon leaves in water for few minutes and let the aroma fill the kitchen.
Put a few drops of vanilla extract on a baking sheet and place it in the oven on low heat.