This study focused on synthesizing a cellulose-based hydrogel nanocomposite as a green hydrogel by adding a microcrystalline cellulose (MC) solution to carboxymethyl cellulose sodium (CMC-Na) with citric acid as a cross-linker. Y2O3 nanoparticles were incorporated during hydrogel preparation in different ratios (0.00% (0 mmol), 0.03% (0.017 mmol), 0.07% (0.04 mmol) and 0.10% (0.44 mmol)). FTIR analysis confirmed the cross-linking reaction, while XRD analysis revealed the hydrogels’ amorphous nature and identified sodium citrate crystals formed from the reaction between citric acid and CMC-Na. The swelling test in deionized water (pH 6.5) at 25 °C showed a maximum swelling percentage of 150% after 24 h in the highest nanoparticle ratio. The resulting cellulose hydrogels were flexible and exhibited significant antibacterial activity against Staphylococcus aureus (S. aureus) and Escherichia coli (E. coli). The synthesized cellulose-based hydrogel nanocomposites are eco-friendly and suitable for medical applications.