Yes, you can compost, even if you live in an apartment. Consider using a small, indoor compost bin designed for apartment use or try vermiculture (worm composting), which is odorless and suitable for indoor environments.