tips for keeping motivation to lose weight?

i’m 5’1 and about 45 pounds over weight, i’ve started to workout and eat better multiple times and it doesn’t even last a week. What can i do to maintain it?