legs giving out during sex

whenever I’m on top during sex with my boyfriend my legs give out after like 30 seconds 😭😭 is there a way I can last longer on top? Any tips will be appreciated 😩