(one) made (one's) bed and (one) must lie in it spoken language
One must experience and deal with the repercussions of a state of affairs that you have created.
A: John didn't study hard, so he failed the test. Now, he is worried that his mom will reproach him. B: He made his bed, and he must lie in it.
She wanted to kill me, but she inadvertently ate the poisoned meal meant for me. She made her bed, and she must lie in it!
The earliest English citation for this oft-repeated proverb is in Gabriel Harvey's Marginalia (c. 1590): "Let them . . . go to their bed, as themselves shall make it." The idiom alludes to times when a permanent bed was a luxury, and most people had to stuff a sack with straw every night for use as a bed.
To be thankful or grateful for one's good luck usually while avoiding a bad situation
You should count your lucky stars as you managed to avoid that violent car accident.