This question is hard to answer. The usage of 'machen' and 'tun' is in many cases idiomatic and fixed, so you have to learn them.
Examples:
die Hausarbeit machen - to do housework
Einkäufe machen - to do the shopping
Essen machen = to make dinner
einen Fehler machen = to make a mistake
Fortschritt machen = to make progress
ein Foto machen = to take a photo
Urlaub machen = to go on holiday
sich (um jmd./etw.) Sorgen machen = to worry (about so./sth.)
In these cases you can't use 'tun'.
es tut mir Leid = I'm sorry
es tut weh = it hurts
das tut nichts zur Sache = that's beside the point
es tut sich nichts = nothing happens
Here 'machen' would be wrong.
To avoid these two words, you could replace them by 'main verbs': instead of 'Essen machen' just 'kochen' (to cook) or instead of 'es tut weh' just 'es schmerzt'.
But in some cases you could use both verbs.
Was soll ich jetzt tun?
Was soll ich jetzt machen?
Both means 'What shall/should I do now?" and is correct.
But I would say (in this case) 'tun' is more general and refers to an upcoming action and 'machen' refers to a insecurity to the immediate next action. Just small nuances.
Was macht er da? / Was tut er da? (What is he doing?)
Was machst du gerade? / Was tust du gerade? (here 'tun' is a little bit more colloquial)
In some dialects the usage is different, or as an auxiliary in everyday language: ich tue etwas schreiben |instead of| ich schreibe etwas