Don’t let dirt become a permanent guest in your house. Take a shower right after you’ve had a bath and use the hot water jet to clean the bathtub. This won’t allow the dirt any time to dry around the sides.
Spray the bathtub with a cleaner and wipe with a damp cloth so that all the residue is gone. For enameled bathtubs, try out the cleaner on a small area first to make sure it’s safe.
In general, make sure to wipe the tub regularly and clean it thoroughly once a month.