rules of chess

sms, same exact thing happened to me in a game im still playing...
my bishop was on the same diagonal as the opposing king, with only an opposing pawn in the way....
but that pawn was protecting another pawn, and i tried to take it with my king...but failed....so you cannot put your king in check no matter what apparently, even if the opposing pawn could not move and take my king (because it would allow the opposing king to be attacked by my bishop....)
can a king take a peice... moving itself into check if that peice, that would need to move in order to effectively "take" the king is pinned?
ex: white's rook takes black's pawn, putting the rook, diagonally SW of the black's king. the space white's rook ocupies after taking black's pawn is guarded by a spot white's knight could attack/defend/move to. Except... blacks queen pins the knight that could defend, to white's king. Can black's king take the rook to it's SW moving into the square of the white's knight... because it's pinned. Or no...