I always find it helpful to go back to basics when trying to figure out why weight loss has stalled or gone backwards so.
Calories - calculate your TDEE and aim for 500 below that as your maximum number per day. That will put you in a deficit and you should lose weight. Composition does matter too, refined carbs can cause bloating, water retention and excess sugars, if you are insulin resistant/insensitive then sugar is more likely to store as fat.
Water - you need lots of it, if you don't have enough then your body will retain it, it's also used in the process of breaking down and disposing of fat (lipolysis) so if you don't drink enough that process won't happen, aim for about 2lts of water/clear fluid a day.
Sleep - it regulates your blood sugar and hormone levels, if you don't get enough it will bugger up your weight loss
Exercise - not excessive but some is helpful, it won't make you lose weight but does help build muscle, improve posture, increase metabolism, break down sugars in your blood to prevent them storing as fat. Every other day and up you water on those days because sore muscles means you'll retain water to heal them.