Your description is rather too vague to give an appropriate conclusion and suggestion
You have not mentioned your age and gender / Nor habits like tobacco and alcohol?
It may be Postural Hypotension
(Blood Pressure) or missed beats
Observe carefully / Sit up in bed a few seconds - Stand by the bed for a few seconds and then walk.
You may have to check your Haemoglobin
, sugar and so on
See your GP or family physician - especially at the time of your symptoms, which may be rather difficult!