Here are the cleanest options listed from simplest(no code) to most flexible I would say. You have to decide best based on your requirement :
Rollup Field ( Simplest)
Use it when you want a simple, no‑code count of child records. , Don’t use it when you need instant updates,rollups refresh on a schedule, not in real time.
Power Automate Flow
Use it when you want near‑real‑time updates without coding.
Form JavaScript ( need bit code)
Use it when you want the count to update instantly on the form as users interact. Don’t use it when the value must stay correct server‑side, in views, reports, or automation, JS only updates the UI unless saved.
Plugin (C#) ( need code)
Use it when you need the most reliable, real‑time, server‑side update every time a record is added or removed. Don’t use it when you want a simple, admin‑friendly solution, plugins require deployment, dev skills, and ALM overhead.
Let me know if you need help for steps to implement any approach.
Regards,
Manoj
✅If this answer helped you, please consider marking it as Verified, it really helps others in community