I feel like I am ruled by my mind and it's illogical behaviour what to do. Thanks
There are several Sutta that deal with this namely;
They are very self explanatory
There is another Sutta that will be helpful -- this one in particular will help understanding the cause of the particular thoughts you are having:
If you want to take it to the next level yet study "the 18 mental explorations" and "the 36 states of attachment", mentioned in this sutta:
These are to be studied and remembered, they are quite easy to understand and i recommend just writing them down. This will be very useful in shedding light on how the mind works in general.
If you are having obsessive thoughts that are making you restless you might also consider these things;
Settling your quarrels
Avoiding restless people & seeking out calm people
Practice not getting involved in conflicts
Practice restraint of speech leading to much discussion
Lower your expectation in regards to being liked or being attended to properly by others
Training supportive mediations such as ie Metta, even if done very briefly will snowball and be of great benefit.
Mindfulness is always useful.