How do we know if we are unsure about something(if it is a sin) that the unrest about that thing is from the holy spirit and not from the world? What does the bible say?
There is danger in the spiritual realm, as worldly spirits deceive us and lead us away from Christ. They may claim even to be the Holy Spirit. The Holy Spirit always leads us to humble submission and unity. As to sin, we have a Church to consult in such matters, and the catechism. Christ taught us in Matthew 18 that the Church is the final voice in all such matters.
You may ask a Priest about matters that you think may be sinful. He can certainly offer you good advice.
You might find the first letter of John (chapter 4) helpful.
We could all benefit from a daily reflection on that chapter. And, as Catholics, we have the incomparable blessing of an authoritative Church to guide us in all matters.