is a conjunction declaring contrast. it roughly means 'however' or 'despite that'

日本は大好きです。しかし、日本の夏がとても暑いです。 I love Japan. However, the summer is very hot!

今日のクラスは難しかった。しかし楽しかった。 Today's class was difficult. However, it was fun.