I have used this code.
\documentclass[12pt]{book}
\usepackage{fontspec}
\setmainfont{Noto Sans Tamil}
\begin{document}
கௌரிப் பாட்டி பொறுமையாய் வெகு நேரம் பஸ்ஸிற்குள் நின்றிருந்தாள். எல்லோரும் இறங்கிய பின், தனது காக்கி நிறப் பையின் கனத்தை இடுப்பில் ஏற்றிக் கொண்டு கடைசியாக வந்தாள்.
"பாட்டி...பாட்டி" பையைத் தூக்கியாரட்டா? ஓரணா குடு பாட்டி."
"வண்டி வேணுங்களா அம்மா?"
"புதுப்பாளையம் வக்கீல் குமாஸ்தா ஐயர் வீடுதானுங்களே....வாங்க, போவோம்" ---என்று பல்வேறு வரவேற்புக் குரல்களுடன் அவளை இறங்கவிடாமல் தடுத்து நின்ற வண்டிக்காரர்களையும், கூலிக்காரச் சிறுவர்களையும் பார்த்துக் கனிவோடு சிரித்துவிட்டுப் பாட்டி சொன்னாள்:
"எனக்கு ஒண்ணும் வேண்டாம்பா..சித்தே வழியை விட்டேள்னா நான் மெள்ள நடந்தே போயிடுவேன்.... ஏண்டாப்பா, வீட்டெக் கூடத் தெரிஞ்சு வெச்சிருக்காய்... நான்தான் மாசம் ஒருதடவை வர்றேனே, என்னிக்கு வண்டியிலே போனேன்?" என்று ஒவ்வொருவருக்கும் ஒவ்வொரு பதிலைச் சொல்லி, அவர்களை விலக்கி வழியமைத்துக் கொண்டு தணலாய்த் தகிக்கும் வெயிலில், முக்காட்டை இழுத்து விட்டுக் கொண்டு, இடுப்பில் ஏற்றிய சுமையுடன் வறுத்துக் கொட்டிய புழுதி மண்ணை அழுந்த அழுந்த மிதித்தவாறு ஒரு பக்கமாய்ச் சாய்ந்து சாய்ந்து நடந்தாள் பாட்டி.
\end{document}
I compiled the above using XeTex and the resulting pdf looks like this
I tried using ragged2e package but it didn't change anything. This text extending beyond margin seems to happen only when I am using Tamil.


polyglossiaas per that answer this problem goes away. – Elad Den Oct 14 '20 at 08:07polyglossiaas suggested and there are mistakes in the resulting pdf. Tamil letters renders incorrectly as shown in this link here. If you see the third word above it is பொறுமையாய் but in the link it comes wrong and word wrapping is not that good. I think usingmicrotypeandbabelhelps me and gives best result. Thank you @EladDen – Shudharson Ragavendirra Oct 14 '20 at 08:49polyglossiain LuaLaTeX, does addingRenderer=HarfBuzzfix the incorrect output? – Davislor Oct 14 '20 at 19:40Renderer=HarfBuzzreally ought to be the default on LuaTeX, at the very least for aScript=that requires it. This is especially a gotcha when someone compiles code that worked in XeTeX. – Davislor Oct 15 '20 at 12:40