Using commas generally is about being logical. Don’t leave them out when needed; don’t add them when not needed. Learn to know what a basic sentence unit is.
Some parts of a sentence are essential for understanding. Knowing which elements are essential will safeguard isolating basics sentence units with commas.