If your compost smells too bad it could be a mix of a few different issues. Your pile could be to wet, it could lack air for circulation or it might have way too much nitrogen in it. It also might smell a little bad because it’s literally a pile of decomposition, but the first three options are just as valid and likely of a problem. Adding dry materials, turning the pile over, and adding brown materials will help with these problems respectively.