by changing your attitude towards life. Ruminating on past which cannot be changed is meaningless, if there is any lesson to be learnt from past learn it and move on.
Similar thing applies to future as well, you can put efforts towards an outcome however it may or may not happen(who would have thought they will be locked down to their home for months in pandemic!)
As great patron saint master oogway says: yesterday is history, tomorrow is mystery but today is a gift. That's why it is called the present :)