If one learned how to do ghusl or wudu and over time forgot an essential or obligatory part of the process, are his prayers still valid from when he or she was doing it incorrectly ?

If you knew how to do it properly and were heedless then you must repeat the prayers and other acts of worship