Hi Krishna,
Try cleaning the earpiece speaker grille at the top of the phone; a toothbrush, 90% or higher concentration isopropyl (rubbing) alcohol and some compressed air may help. If not, your speaker may have failed and be in need of replacement. Sad to say iFixit doesn't have a guide to show you how to do that, but there's a Spanish site called Nadie Me Llama Gallina that has just what you need.
[link|https://www.nadiemellamagallina.com/en/manuales/smartphones-1/samsung-4/samsung-galaxy-a21s-1238/auricular-11042|Manuales / Samsung Galaxy A21s / Handset|new_window=true]
You should be able to find replacement parts easily enough; I usually start with Amazon, eBay and AliExpress. Here's a quick example that should work.
[link|https://www.aliexpress.us/item/3256803117390279.html|For Samsung Galaxy A21S A217 A325 Ear Earpiece Speaker Replacement Part - AliExpress|new_window=true]