My attitude = the sum total of my thoughts & beliefs.
If I've worked at keeping my ego smashed, taking an inventory of my grosser handicaps, and taking note of the ways that I may not have treated others with respect, patience, consideration, love and tolerance -- discussed this with another person, became entirely willing to have God change me and remove the handicaps, asked God to remove them -- made a list of anyone that I've harmed and made direct amends to them -- I find that my thoughts have automatically been placed on a Higher plane.
If I'm continuing to watch for selfishness, dishonesty and fear and resentments -- and I'm looking to see what I can add to the good in Life, and how I can be helpful to others -- I find that I am less likely to be harming others.... and I usually discover that my attitude has been pretty good and positive.
With the good and positive attitude -- that results from having good thoughts about Life, others and myself -- I've discovered that I have much less to inventory in the liabilities side of my inventory -- and a tremendous amount that I can add to my assets side of my inventory. And, that helps me to feel even better about myself. And, when I'm feeling good about me and what I'm doing, and going about Life with a good attitude -- I'm more likely to be of help to myself and to others -- and this adds to the "feeling good" cycle of my life.
I also have a conscience. My conscience seems to be a God given kind of thing -- that lets me know if there is integrity in my actions and in my thoughts.
The more that I've removed from myself that has blocked me from Good -- I discover that I'm having many more of those "hunches" and inspirational thoughts -- that seem to come from that Higher plane of Living.
For me -- I find that it is very difficult for me to treat someone else in a harmful or unhelpful way -- when my thinking is inspired by Good. Good actions leads to Good thinking and Good thinking automatically produces a Good attitude.