1Used to stress that something took effort or trouble to achieve; often paired with "~のに" to express disappointment when that effort doesn't pay off ("having gone to the trouble of...").
せっかく来たのに、店が閉まっていた。
I went all that way, but the shop was closed.
せっかく作った料理なのに、誰も食べてくれなかった。
I went to the trouble of cooking, but no one ate it.
せっかく早起きしたのに、電車が止まっていた。
I bothered to get up early, but the trains had stopped running.
せっかくだから、もう少しゆっくりしていってください。
Since you've gone to the trouble of coming, please stay and relax a bit longer.
2Used in the form "せっかくの〜" to describe a rare, valuable opportunity or a long-awaited thing.
せっかくの機会を無駄にしてはいけない。
You shouldn't waste such a valuable opportunity.
せっかくの休日だから、家でゆっくり過ごしたい。
Since it's a precious day off, I want to spend it relaxing at home.
せっかくのご厚意ですが、今回は遠慮させていただきます。
I appreciate your kind offer, but I'll have to decline this time.
3(rare, somewhat old-fashioned) Describes kindness or generosity of spirit.
せっかくな計らいに、みんな感謝した。
Everyone was grateful for the kind arrangement.
4An adverb meaning "specially" or "expressly" — done deliberately for a particular purpose.
せっかく用意したプレゼントを見せてあげた。
I showed them the present I had prepared especially for them.
先生がせっかく時間を作ってくださったので、しっかり質問しよう。
Since the teacher expressly made time for us, let's make good use of it and ask questions.